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.

关于在ccs5.3中编译工程后出现错误的原因



小弟最近用28035来调试PFC电路。昨晚在用CCS5.3进行工程编译的时候发现RAM到CPU时出现了一个错误,大致意思是28035_RAM_lnk.cmd文件中给分配的地址不够。 后来操作Flash(即把CMD文件换成F28035.cmd)又能编译成功,未出现错误。想问一下这是问题怎么解决呢? 难道是我全局变量多了,cmd中分配的地址不够吗?

  • 是的,请加大ram.cmd文件中.text空间。
    processors.wiki.ti.com/.../C28x_Compiler_-_Understanding_Linking

    Q: The linker says "placement fails for object '.text' ". How can I make more memory available for .text?

    There are a few options - here are three:

    Option 1
    The linker command file (.cmd) specifies how memory will be allocated for the project. You can try modifying the .cmd file to allow for a larger .text section. For example, you can try combining contiguous RAM blocks or flash sectors to make a larger block for code.
  • 小弟最近用28035来调试PFC电路。昨晚在用CCS5.3进行工程编译的时候发现RAM到CPU时出现了一个错误,大致意思是28035_RAM_lnk.cmd文件中给分配的地址不够。 后来操作Flash(即把CMD文件换成F28035.cmd)又能编译成功,未出现错误。想问一下这是问题怎么解决呢? 难道是我全局变量多了,cmd中分配的地址不够吗?
    Eric:
    cmd是用来分配代码存储的映射的,比如代码放在哪个存储空间,全局变量放哪里RAM等。
    故障就是因为代码超过了映射的存储空间,所以报错了,把L0L1L2合并成一大块。
  • 我看了下28035的RAM_lnk.cmd文件,.text对映着RAML0L1,.ebss .econst. .esysmem这三个段对应着RAML2,但是RAML0L1属于PAGE=0,被分配到存储空间。而RAML2属于PAGE=1的数据空间,把他们两合并成一大块,不会出现什么问题吗?