0. 软件环境简介
0.1 集成开发环境:
IAR Embedded Workbench for MSP430 IDEV7.10.1
IAR Embedded Workbench sharedcomponents V8.0.4.4801
1. 问题描述
一天,我用相同代码,相同版本IAR,重建一个工程,在编译软件过程中,出现以下错误:
Error[e104]: Failed to fit all segmentsinto specified ranges. Problem discovered in segment CODE. Unable to place 169block(s) (0x366e byte(s) total) in 0x365c byte(s) of memory. The problem occurred while processing the segmentplacement command "-P(CODE)CODE,CODE16=C400-FF7F", where at themoment of placement the available memoryranges were "CODE:c924-ff7f"
2. 问题处理
代码相同,软件相同,无它,应该是软件配置出了问题。对比了选项后,发现2个相关配置页:
以上,无论是选择修改“General Options”页还是“C/C++ Compiler”页,都能够编译通过。不过相对而言,仅修改“General Options”更好,代码优化可能会影响软件运行细节。