Skip to content

[BACKPORT] arch/arm/stm32: set F412 SRAM1_END to 256KiB - #406

Merged
dakejahl merged 1 commit into
px4_firmware_nuttx-10.3.0+from
dakejahl/stm32f412-sram
Sep 2, 2026
Merged

[BACKPORT] arch/arm/stm32: set F412 SRAM1_END to 256KiB#406
dakejahl merged 1 commit into
px4_firmware_nuttx-10.3.0+from
dakejahl/stm32f412-sram

Conversation

@dakejahl

@dakejahl dakejahl commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of apache/nuttx#20039, now merged upstream as 65d0b3f.

Give STM32F412 the 256 KiB of system SRAM it actually has. The F2/F4 heap map had no F412 entry, so SRAM1_END was the 128 KiB default.

Problem

Every F412 (CE/CG/VG/ZG) has 256 KiB at 0x20000000 and no CCM. stm32_allocateheap.c listed F401/F410/F427/F429/F446/F469 and dumped F412 into the 128 KiB else, so up_allocate_heap() ended at 0x20020000.

Solution

Set SRAM1_END to 0x20040000 when CONFIG_STM32_STM32F412 is selected.

12.12 carry is #407. PX4-Autopilot gitlink and 256K linker scripts are PX4/PX4-Autopilot#28498, stacked on #28456.

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>
(cherry picked from commit 65d0b3f)

Backport note: this tree still has stm32_allocateheap.c under
arch/arm/src/stm32; upstream moved the F2/F4 heap map to
arch/arm/src/common/stm32/stm32_allocateheap_m3m4_v1.c.
@dakejahl
dakejahl force-pushed the dakejahl/stm32f412-sram branch from c4e70a1 to bd6f6b4 Compare September 2, 2026 16:47
dakejahl added a commit to PX4/PX4-Autopilot that referenced this pull request Sep 2, 2026
Picks up PX4/NuttX#406, which sets SRAM1_END to 0x20040000 for the
F412. The gitlink is the 10.3 tip, so this also carries PX4/NuttX#401.

Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com>
@dakejahl
dakejahl merged commit e1db398 into px4_firmware_nuttx-10.3.0+ Sep 2, 2026
@dakejahl
dakejahl deleted the dakejahl/stm32f412-sram branch September 2, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant