开启一段ram空间
打开ld文件

配置一段ram空间

开辟一个段

.shareable_data1 : {. = ALIGN(4);KEEP(*(.mcal_shared_data1)) . = ALIGN(4);} > int_sram_shareable1
定义一个变量并将变量指定在段中

volatile uint32 u32SbcmGenState __attribute__((section (".mcal_shared_data1")));
编译并查看map文件变量存储位置

我们可以看到变量已经存放在我们指定的地址空间段了。自此结束。