h7.cmake 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. set(STM32_H7_TYPES
  2. H723xx H725xx H730xx H730xxQ H733xx H735xx
  3. H743xx H753xx H750xx H742xx H745xx H755xx H747xx H757xx
  4. H7A3xx H7A3xxQ H7B3xx H7B3xxQ H7B0xx H7B0xxQ
  5. )
  6. set(STM32_H7_TYPE_MATCH
  7. "H723.." "H725.." "H730.." "H730..Q" "H733.." "H735.."
  8. "H743.." "H753.." "H750.." "H742.." "H745.." "H755.." "H747.." "H757.."
  9. "H7A3.." "H7A3..Q" "H7B3.." "H7B3..Q" "H7B0.." "H7B0..Q"
  10. )
  11. set(STM32_H7_RAM_SIZES
  12. 128K 128K 128K 128K 128K 128K
  13. 128K 128K 128K 128K 128K 128K 128K 128K
  14. 128K 128K 128K 128K 128K 128K
  15. )
  16. set(STM32_H7_M4_RAM_SIZES
  17. 0K 0K 0K 0K 0K 0K
  18. 0K 0K 0K 0K 288K 288K 288K 288K
  19. 0K 0K 0K 0K 0K 0K
  20. )
  21. set(STM32_H7_CCRAM_SIZES
  22. 0K 0K 0K 0K 0K 0K
  23. 0K 0K 0K 0K 0K 0K 0K 0K
  24. 0K 0K 0K 0K 0K 0K
  25. )
  26. set(STM32_H7_NO_FLASH_SPLIT
  27. H723xx H725xx H730xx H730xxQ H733xx H735xx
  28. H750xx H7B0xx H7B0xxQ
  29. )
  30. set(STM32_H7_DUAL_CORE
  31. H745xx H755xx H747xx H757xx
  32. )
  33. stm32_util_create_family_targets(H7 M7)
  34. target_compile_options(STM32::H7::M7 INTERFACE
  35. -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard
  36. )
  37. target_link_options(STM32::H7::M7 INTERFACE
  38. -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard
  39. )
  40. target_compile_definitions(STM32::H7::M7 INTERFACE
  41. -DCORE_CM7
  42. )
  43. stm32_util_create_family_targets(H7 M4)
  44. target_compile_options(STM32::H7::M4 INTERFACE
  45. -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
  46. )
  47. target_link_options(STM32::H7::M4 INTERFACE
  48. -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
  49. )
  50. target_compile_definitions(STM32::H7::M4 INTERFACE
  51. -DCORE_CM4
  52. )
  53. function(stm32h7_get_memory_info DEVICE TYPE CORE RAM FLASH_ORIGIN RAM_ORIGIN TWO_FLASH_BANKS)
  54. if(${TYPE} IN_LIST STM32_H7_NO_FLASH_SPLIT)
  55. set(${TWO_FLASH_BANKS} FALSE PARENT_SCOPE)
  56. else()
  57. set(${TWO_FLASH_BANKS} TRUE PARENT_SCOPE)
  58. endif()
  59. if(NOT CORE)
  60. set(CORE "M7")
  61. endif()
  62. list(FIND STM32_H7_TYPES ${TYPE} TYPE_INDEX)
  63. if(CORE STREQUAL "M7")
  64. list(GET STM32_H7_RAM_SIZES ${TYPE_INDEX} RAM_VALUE)
  65. set(${RAM} ${RAM_VALUE} PARENT_SCOPE)
  66. set(${FLASH_ORIGIN} 0x8000000 PARENT_SCOPE)
  67. set(${RAM_ORIGIN} 0x20000000 PARENT_SCOPE)
  68. elseif((${TYPE} IN_LIST STM32_H7_DUAL_CORE) AND (CORE STREQUAL "M4"))
  69. list(GET STM32_H7_M4_RAM_SIZES ${TYPE_INDEX} RAM_VALUE)
  70. set(${RAM} ${RAM_VALUE} PARENT_SCOPE)
  71. set(${FLASH_ORIGIN} 0x8100000 PARENT_SCOPE)
  72. set(${RAM_ORIGIN} 0x10000000 PARENT_SCOPE)
  73. else()
  74. message(FATAL_ERROR "Unknown core ${CORE}")
  75. endif()
  76. endfunction()
  77. function(stm32h7_get_device_cores DEVICE TYPE CORES)
  78. if(${TYPE} IN_LIST STM32_H7_DUAL_CORE)
  79. set(${CORES} M7 M4 PARENT_SCOPE)
  80. else()
  81. set(${CORES} M7 PARENT_SCOPE)
  82. endif()
  83. endfunction()