h7.cmake 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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_DUAL_CORE
  27. H745xx H755xx H747xx H757xx
  28. )
  29. stm32_util_create_family_targets(H7 M7)
  30. target_compile_options(STM32::H7::M7 INTERFACE
  31. -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard
  32. )
  33. target_link_options(STM32::H7::M7 INTERFACE
  34. -mcpu=cortex-m7 -mfpu=fpv5-sp-d16 -mfloat-abi=hard
  35. )
  36. target_compile_definitions(STM32::H7::M7 INTERFACE
  37. -DCORE_CM7
  38. )
  39. stm32_util_create_family_targets(H7 M4)
  40. target_compile_options(STM32::H7::M4 INTERFACE
  41. -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
  42. )
  43. target_link_options(STM32::H7::M4 INTERFACE
  44. -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
  45. )
  46. target_compile_definitions(STM32::H7::M4 INTERFACE
  47. -DCORE_CM4
  48. )
  49. function(stm32h7_get_memory_info DEVICE TYPE CORE RAM FLASH_ORIGIN RAM_ORIGIN TWO_FLASH_BANKS)
  50. if(${TYPE} IN_LIST STM32_H7_DUAL_CORE)
  51. set(${TWO_FLASH_BANKS} TRUE PARENT_SCOPE)
  52. else()
  53. set(${TWO_FLASH_BANKS} FALSE PARENT_SCOPE)
  54. endif()
  55. if(NOT CORE)
  56. set(CORE "M7")
  57. endif()
  58. list(FIND STM32_H7_TYPES ${TYPE} TYPE_INDEX)
  59. if(CORE STREQUAL "M7")
  60. list(GET STM32_H7_RAM_SIZES ${TYPE_INDEX} RAM_VALUE)
  61. set(${RAM} ${RAM_VALUE} PARENT_SCOPE)
  62. set(${FLASH_ORIGIN} 0x8000000 PARENT_SCOPE)
  63. set(${RAM_ORIGIN} 0x20000000 PARENT_SCOPE)
  64. elseif((${TYPE} IN_LIST STM32_H7_DUAL_CORE) AND (CORE STREQUAL "M4"))
  65. list(GET STM32_H7_M4_RAM_SIZES ${TYPE_INDEX} RAM_VALUE)
  66. set(${RAM} ${RAM_VALUE} PARENT_SCOPE)
  67. set(${FLASH_ORIGIN} 0x8100000 PARENT_SCOPE)
  68. set(${RAM_ORIGIN} 0x10000000 PARENT_SCOPE)
  69. else()
  70. message(FATAL_ERROR "Unknown core ${CORE}")
  71. endif()
  72. endfunction()
  73. function(stm32h7_get_device_cores DEVICE TYPE CORES)
  74. if(${TYPE} IN_LIST STM32_H7_DUAL_CORE)
  75. set(${CORES} M7 M4 PARENT_SCOPE)
  76. else()
  77. set(${CORES} M7 PARENT_SCOPE)
  78. endif()
  79. endfunction()