diff --git a/arch/arm/src/stm32/Kconfig b/arch/arm/src/stm32/Kconfig index 714a87ce0e..de7d47b108 100644 --- a/arch/arm/src/stm32/Kconfig +++ b/arch/arm/src/stm32/Kconfig @@ -606,11 +606,13 @@ config STM32_STM32F20XX default n select STM32_HAVE_OTGFS select STM32_HAVE_FSMC + select STM32_HAVE_CCM config STM32_STM32F30XX bool default n select STM32_HAVE_USBDEV + select STM32_HAVE_CCM config STM32_STM32F40XX bool @@ -625,23 +627,27 @@ config STM32_STM32F405 bool default n select STM32_HAVE_FSMC + select STM32_HAVE_CCM config STM32_STM32F407 bool default n select STM32_HAVE_FSMC + select STM32_HAVE_CCM # This is really 427/437, but we treat the two the same. config STM32_STM32F427 bool default n select STM32_HAVE_FSMC + select STM32_HAVE_CCM # This is really 429/439, but we treat the two the same. config STM32_STM32F429 bool default n select STM32_HAVE_FSMC + select STM32_HAVE_CCM config STM32_DFU bool "DFU bootloader" @@ -1304,8 +1310,8 @@ config ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG config STM32_CCMEXCLUDE bool "Exclude CCM SRAM from the heap" - depends on STM32_STM32F20XX || STM32_STM32F40XX || STM32_STM32F30XX default y if ARCH_DMA || ELF + depends on STM32_HAVE_CCM ---help--- Exclude CCM SRAM from the HEAP because (1) it cannot be used for DMA and (2) it appears to be impossible to execute ELF modules from CCM diff --git a/arch/arm/src/stm32/stm32_allocateheap.c b/arch/arm/src/stm32/stm32_allocateheap.c index 98cecf1dc1..a89f38c90f 100644 --- a/arch/arm/src/stm32/stm32_allocateheap.c +++ b/arch/arm/src/stm32/stm32_allocateheap.c @@ -63,7 +63,7 @@ * following definitions must be provided to specify the size and * location of internal(system) SRAM: * - * CONFIG_RAM_END : End address (+1) of SRAM (F1 family only, the + * CONFIG_RAM_END : End address (+1) of SRAM (F1 family only, the * : F4 family uses the a priori end of SRAM) * * The F4 family also contains internal CCM SRAM. This SRAM is different @@ -148,12 +148,12 @@ # undef CONFIG_STM32_CCMEXCLUDE # define CONFIG_STM32_CCMEXCLUDE 1 -/* Members of teh STM32F30xxx family has a variable amount of SRAM from 24 - * to 40Kb plus 8KB if CCM SRAM. No external RAM is supported (the F3 family has no - * FSMC). +/* Members of the STM32F30xxx family has a variable amount of SRAM from 24 + * to 40Kb plus 8KB if CCM SRAM. No external RAM is supported (the F3 family + * has no FSMC). * - * As a complication, CCM SRAM cannot be used for DMA. So, if STM32 DMA is enabled, CCM SRAM - * should probably be excluded from the heap. + * As a complication, CCM SRAM cannot be used for DMA. So, if STM32 DMA is + * enabled, CCM SRAM should probably be excluded from the heap. */ #elif defined(CONFIG_STM32_STM32F30XX) @@ -252,9 +252,9 @@ #elif defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F40XX) - /* The STM32 F2 has no CCM SRAM */ + /* The STM32 F2 and the STM32 F401 have no CCM SRAM */ -# ifdef CONFIG_STM32_STM32F20XX +# if defined(CONFIG_STM32_STM32F20XX) || defined(CONFIG_STM32_STM32F401) # undef CONFIG_STM32_CCMEXCLUDE # define CONFIG_STM32_CCMEXCLUDE 1 # endif