Skip to content

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

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

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

Conversation

@dakejahl

@dakejahl dakejahl commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport of apache/nuttx#20039 (upstream 65d0b3f) to px4_firmware_nuttx-12.12.0+. 10.3 carry is #406.

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.

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.
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