This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 65d0b3f1ce2 arch/arm/stm32: set F412 SRAM1_END to 256KiB
65d0b3f1ce2 is described below
commit 65d0b3f1ce2cb7ffc63530f609d4be624ee63f7b
Author: Jacob Dahl <[email protected]>
AuthorDate: Tue Sep 1 14:25:25 2026 -0600
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 <[email protected]>
---
arch/arm/src/common/stm32/stm32_allocateheap_m3m4_v1.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm/src/common/stm32/stm32_allocateheap_m3m4_v1.c
b/arch/arm/src/common/stm32/stm32_allocateheap_m3m4_v1.c
index 010ede1eeb3..f314532f8a3 100644
--- a/arch/arm/src/common/stm32/stm32_allocateheap_m3m4_v1.c
+++ b/arch/arm/src/common/stm32/stm32_allocateheap_m3m4_v1.c
@@ -329,10 +329,15 @@
*
* 5) 64Kib of System SRAM beginning at address 0x2002:0000
*
+ * The STM32F412 family has 256KiB of System SRAM in one bank and no CCM:
+ *
+ * 6) 256KiB of System SRAM beginning at address 0x2000:0000
+ *
* As determined by the linker script, g_heapbase lies in the 112KiB memory
* region and that extends to 0x2001:0000. But the first and second memory
* regions are contiguous and treated as one in this logic that extends to
- * 0x2002:0000 (or 0x2003:0000 for the F427/F437/F429/F439).
+ * 0x2002:0000 (or 0x2003:0000 for the F427/F437/F429/F439, or 0x2004:0000
+ * for the F412).
*
* 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 or the
@@ -363,6 +368,8 @@
# define SRAM1_END 0x20008000
# elif defined(CONFIG_STM32_STM32F427) || defined(CONFIG_STM32_STM32F429)
# define SRAM1_END 0x20030000
+# elif defined(CONFIG_STM32_STM32F412)
+# define SRAM1_END 0x20040000
# elif defined(CONFIG_STM32_STM32F446)
# define SRAM1_END 0x20020000
# elif defined(CONFIG_STM32_STM32F469)