Skip to content

Commit 65d0b3f

Browse files
dakejahlxiaoxiang781216
authored andcommitted
arch/arm/stm32: set F412 SRAM1_END to 256KiB
The F412 has 256KiB of system SRAM at 0x20000000 and no CCM. The F2/F4 heap map had no F412 entry, so it used the 128KiB default at 0x20020000 and left the upper half unused. Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
1 parent 02c4f98 commit 65d0b3f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

arch/arm/src/common/stm32/stm32_allocateheap_m3m4_v1.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,10 +329,15 @@
329329
*
330330
* 5) 64Kib of System SRAM beginning at address 0x2002:0000
331331
*
332+
* The STM32F412 family has 256KiB of System SRAM in one bank and no CCM:
333+
*
334+
* 6) 256KiB of System SRAM beginning at address 0x2000:0000
335+
*
332336
* As determined by the linker script, g_heapbase lies in the 112KiB memory
333337
* region and that extends to 0x2001:0000. But the first and second memory
334338
* regions are contiguous and treated as one in this logic that extends to
335-
* 0x2002:0000 (or 0x2003:0000 for the F427/F437/F429/F439).
339+
* 0x2002:0000 (or 0x2003:0000 for the F427/F437/F429/F439, or 0x2004:0000
340+
* for the F412).
336341
*
337342
* As a complication, CCM SRAM cannot be used for DMA. So, if STM32 DMA is
338343
* enabled, CCM SRAM should probably be excluded from the heap or the
@@ -363,6 +368,8 @@
363368
# define SRAM1_END 0x20008000
364369
# elif defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429)
365370
# define SRAM1_END 0x20030000
371+
# elif defined(CONFIG_STM32_STM32F412)
372+
# define SRAM1_END 0x20040000
366373
# elif defined(CONFIG_STM32_STM32F446)
367374
# define SRAM1_END 0x20020000
368375
# elif defined(CONFIG_STM32_STM32F469)

0 commit comments

Comments
 (0)