|
之前以为只能定义到AC5下,测试了下AC6下也是正常的。
- /* 定义在512KB AXI SRAM里面的变量 */
- __attribute__((section (".RAM_D1"))) uint32_t AXISRAMBuf[10] = {1,2,3,4,5,6,7,8,9,0};
- __attribute__((section (".RAM_D1"))) uint16_t AXISRAMCount;
- /* 定义在128KB SRAM1(0x30000000) + 128KB SRAM2(0x30020000) + 32KB SRAM3(0x30040000)里面的变量 */
- __attribute__((section (".RAM_D2"))) uint32_t D2SRAMBuf[10] = {1,2,3,4,5,6,7,8,9,0};
- __attribute__((section (".RAM_D2"))) uint16_t D2SRAMount;
- /* 定义在64KB SRAM4(0x38000000)里面的变量 */
- __attribute__((section (".RAM_D3"))) uint32_t D3SRAMBuf[10] = {1,2,3,4,5,6,7,8,9,0};
- __attribute__((section (".RAM_D3"))) uint16_t D3SRAMCount;
复制代码
详情看V7教程的这个章节即可:
http://www.armbbs.cn/forum.php?mod=viewthread&tid=86980
这里特别注意一点,如果是固定地址用到AC6下载,需要用这个帖子的方案:
AC6使用 __attribute__((at(x)))需要改用__attribute__((section("name")))实现
http://www.armbbs.cn/forum.php?mod=viewthread&tid=93202
|
|