Memory placement assigns code and data to specific address ranges. In bare-metal firmware, a linker script defines where executable code, constants, variables, the interrupt vector table, and the stack reside. section 4.1
Rust attributes can control data representation, alignment, and section placement; linker scripts define the memory regions that sections occupy. These controls matter when hardware can access only particular RAM regions. section 5.4 section 7.2.6
For a buffer used by a peripheral:
- Prefer static storage with explicit memory-region placement when the peripheral cannot reach every RAM region. section 7.2.6
- Use linker scripts and section attributes to fix the buffer's address at link time; verify that its region is reachable by the peripheral. section 5.4 section 7.2.6
DMA reachability
On an STM32H7, the main DMA controllers can reach DTCM, while the low-power BDMA peripheral is limited to a particular SRAM block. A statically placed buffer makes its address checkable against the peripheral's reachable regions. section 7.2.6
