This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

IAR环境下如何利用CC3200的低16KRAM?

Other Parts Discussed in Thread: CC3200

 试图通过修改 IAR的 icf 文件实现对CC3200的低16KRAM的利用,但是始终没有成功.

我的思路是建立一个新的段,然后将某些变量定义到这个区域, 使用的环境是 IAR 7.5

icf 文件定义如下:

方法1. 

define region CFGZone = mem:[from 0x20000000 to 0x20003FFF];    /* 低16K*/
place in CFGZone { readwrite section RAM_Low16K };

方法2

.place at address mem:0x20005000 { readwrite section .RAM Low16K};

程序中定义如下:

/#pragma location = "RAM_Low16K"
u32 ABC;

或者

vu32  ABC   @"RAM_Low16K" =0x123;

  • /#pragma location = "RAM_Low16K" 这句是不是多了个/?其他没看出语法问题
  • Viki Shi 说:
    /#pragma location = "RAM_Low16K" 这句是不是多了个/?其他没看出语法问题

    Sorry 应该是:

    #pragma location = "RAM_Low16K"

  • 那语法没问题啊
  • 问题已经解决:

        在 icf 文件中放置说明语句的位置有问题,CC3200.icf文件中有很多条件语句,我将说明语句放置到一个条件中,而该条件不满足导致语句失效。

    下面是适当去掉注释后 CC3200.icf 文件的后半部分,将说明语句放置到第一个条件块中,或者干脆放置到条件块外部就可以

    if (!isdefinedsymbol(Flash)){
    place at start of SRAM { readonly section .intvec };
    place in SRAM { readonly };
    place in SRAM { section VTABLE };
    place in SRAM { block CmdTbl };
    place in SRAM { readwrite, block HEAP };

    place in mem:[from 0x20000000 to 0x20003FFF] { readwrite section RAM_Low16K};  //   正确的放置1


    } else
    if (!Flash) {
    place at start of SRAM { readonly section .intvec };
    place in SRAM { readonly };
    place in SRAM { section VTABLE };
    place in SRAM { block CmdTbl };
    place in SRAM { readwrite, block HEAP };

    } else {
    place at start of FLASH { readonly section .intvec };
    place in FLASH { readonly };
    place in FLASH { block CmdTbl };
    place in SRAM { section VTABLE };
    place in SRAM { readwrite, block HEAP };
    }

    place in mem:[from 0x20000000 to 0x20003FFF] { readwrite section RAM_Low16K};  //   正确的放置2

  • 恭喜解决,也非常感谢你的详细反馈:)