|
参考硬汉的内存分配例程“基于STM32H7的TCM,SRAM,SDRAM等六块内存区的动态内存分配”,
第一种写法:
/* D2域, 128KB SRAM1(0x30000000) + 128KB SRAM2(0x30020000) + 32KB SRAM3(0x30040000) */
static uint64_t memory_d2[MD_D2_SIZE / 8]__attribute__((section(".ARM.__at_0x30000000")));
/* D3域, SRAM4, 地址: 0x3800 0000, 大小64KB */
static uint64_t memory_d3[MD_D3_SIZE / 8]__attribute__((section(".ARM.__at_0x38000000")));
问题:在某些情况会出现
Error: L6077E: Region table entry for region RW_IRAM4 is missing.
第二种写法:(仅修改memory_d3的定义方式,其余不变)
/* D2域, 128KB SRAM1(0x30000000) + 128KB SRAM2(0x30020000) + 32KB SRAM3(0x30040000) */
static uint64_t memory_d2[MD_D2_SIZE / 8]__attribute__((section(".ARM.__at_0x30000000")));
/* D3域, SRAM4, 地址: 0x3800 0000, 大小64KB */
static uint64_t memory_d3[MD_D3_SIZE / 8]__attribute__((section(".RAM_D3")));
现象:不报错,并且map文件中meory_d3也在 0x38000000
请教各位:1)上面两种写法,哪种是AC6下正确的方式;2)为什么有时第一种写法会报错。谢谢
|
|