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.

MSP430G2553程序移植到MSP430G2452上编译错误的解决方法(内存不足)

Other Parts Discussed in Thread: MSP430G2452

错误信息如下所示:

"../lnk_msp430g2452.cmd", line 93: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".stack" size 0x50 . Available memory ranges:
RAM size: 0x100 unused: 0x40 max hole: 0x40
remark #10371-D: (ULP 1.1) Detected no uses of low power mode state changing instructions
error #10010: errors encountered during linking; "000.out" not built

根据错误提示,是程序不能写入可用的内存。

经过比对2452余2553两个的cmd文件,发现内存确实不是一样大的。查看官方资料2452的内存为256字节。刚好是0x100

修改cmd试试,将默认的0x100修改大一点看看效果。

改成了0x150编译成功了。原来刚刚超额了一点点。

MSP430:  Flash/FRAM usage is 664 bytes. RAM usage is 272 bytes.

试试运行效果。不行,所以可以根据这个结果进行优化程序。事实证明,不能做欺骗编译器的事情,实际是多少就是多少。。。

  • 这种情况,建议尝试修改开发环境的优化级别和优化选项,向减少存储空间方向调节下。
    对这种超过存储空间不是太多的情况下,进行优化很管用。
  • 是的,我转发了一个播放音乐的蜂鸣器程序,刚才测试了一下,难听死了,我准备重新做个蜂鸣器播放歌曲的例子。这个贴是测试过程发现的,然后分享过来,说不定谁遇到了,知道问题出在哪儿。