不能用RAM的不同部分
用STM32H7和STM32 Cube IDE在linker script中添加了这个:/* Memories definition */MEMORY{DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128KITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64KRAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512KRAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288KRAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64KFLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K} /* Sections */SECTIONS{.ramd2block :{ . = ALIGN(4); _sramd2block = .; /* create a global symbol at ccmram start */ *(.ramd2block) *(.ramd2block*) . = ALIGN(4); _eramd2block = .; /* create a global symbol at ccmram end */} > RAM_D2 .ramd3block (NOLOAD) :{ KEEP(*(.ramd3section))} > RAM_D3但它会一直在DTCM RAM中定位此缓冲区:uint8_tSPI1_TxBuffer __attribute__(( section(".ramd2block") )); // SPI Tx当我看.map:.ramd2block 0x00000000200001f8 0x1b load address 0x000000000800e2f4 .ramd2block 0x00000000200001f8 0x1b Core/Src/main.o 0x00000000200001f8 SPI1_TxBuffer 0x0000000020000214 . = ALIGN (0x4)0x2000000在DTCM RAM中,为什么链接器没有在RAM_D2中定位缓冲区是什么原因呢?
页:
[1]