diff --git a/boards/kakute-f7-mini-v3/memory.x b/boards/kakute-f7-mini-v3/memory.x index 06bfc75..a022eb0 100644 --- a/boards/kakute-f7-mini-v3/memory.x +++ b/boards/kakute-f7-mini-v3/memory.x @@ -1,5 +1,20 @@ MEMORY { FLASH : ORIGIN = 0x08000000, LENGTH = 512K - RAM : ORIGIN = 0x20000000, LENGTH = 256K + + /* + * STM32F722 RAM totals 256 KiB: + * - DTCM: 64 KiB at 0x2000_0000; inaccessible to DMA1 and DMA2. + * - SRAM1: 176 KiB at 0x2001_0000; contiguous and DMA2-accessible. + * - SRAM2: 16 KiB at 0x2004_C000; a separate bank after an address gap. + * + * Why use SRAM1 as the only default RAM region: the MPU6000 SPI DMA buffers + * and USART1 TX DMA frames are ordinary RTIC task-local/static allocations. + * Mapping `RAM` to DTCM would let the linker place those buffers where DMA2 + * cannot read or write them which would lead transfer faults or corrupted data. + * + * Therefore all default allocations use SRAM1 to make DMA reachability the + * safe default rather than a per-buffer convention. + */ + RAM : ORIGIN = 0x20010000, LENGTH = 176K }