问题描述:
错误描述Error[e16]: Segment CSTACK (size: 0x50 align: 0x1) is too long for segment definition. At least 0x2b more bytes needed. The problem occurred
while processing the segment placement command “-Z(DATA)CSTACK+_STACK_SIZE#”, where at the moment of placement the available
memory ranges were “CODE:9db-9ff”
Reserved ranges relevant to this placement:
200-263 DATA16_I
264-9da DATA16_Z
9db-9ff CSTACK
原因分析:
此错误是所定义的全局变量和数组缓冲区等所占的RAM超出硬件支持所致:size: 0x50 为超出的大小。只要减少不要的全局变量以及尽量缩小数组缓冲区就可以了!
解决方案:
将stack设置改小,具体在option->general option->stack/heap 中将第一列Stack size改小一点,但是不能太小,要不程序计算就会出错,如果出现程序运行结果不正确了就减少程序中的变量个数,还有变量类型尽量小,够用就可以,能减少动态运行时RAM的占用量。