(1)程序烧写到DSP片内FLASH内后,运行正常,串口发送字符正常。断开仿真器,重新下电,上电后,串口发送字符乱码。
问题分析:CMD文件配置问题,导致关键参数配置到内部RAM中去,掉电后丢失。
问题原因:CMD文件中,econst: > RAML0L3, PAGE = 1,配制成了RAM,导致掉电后上电串口发送乱码。更改为.econst: > FLASH, PAGE = 0后,程序运行正常,串口发送字符正常。
.econst:是在使用大存储器模式时使用的,包括字符串,声明,以及被明确初始化过的全局变量和静态变量,可以放在数据页得任何地方。
CMD文件如下:
MEMORYSECTIONS
{
.vectors: load = 0x000000000
.text: > FLASH, PAGE = 0
.switch: > FLASH, PAGE = 0
.bss: > RAML0L3, PAGE = 1
.ebss: > RAML0L3, PAGE = 1
.far: > RAML0L3, PAGE = 1
.cinit: > FLASH, PAGE = 0
.pinit: > FLASH, PAGE = 0
.const: > RAML0L3, PAGE = 1
.econst: > FLASH, PAGE = 0
.reset: > RESET, PAGE = 0, TYPE = DSECT
.data: > RAML0L3, PAGE = 1
.cio: > RAML0L3, PAGE = 1
.sysmem: > RAML0L3, PAGE = 1
.esysmem:> RAML0L3, PAGE = 1
.stack: > RAMM1, PAGE = 1
.rtdx_text: > FLASH, PAGE = 0
.rtdx_data: > RAML0L3, PAGE = 1
IQmath: > FLASH, PAGE = 0
codestart: > BEGINFLASH, PAGE = 0
csmpasswds: > CSM_PWL, PAGE = 0
csm_rsvd: > RAMM0, PAGE = 0
ramfuncs: > FLASH, PAGE = 0
.adc_cal: > ADC_CAL, PAGE = 0 , TYPE = NOLOAD
IQmathTables: > FLASH, PAGE = 0 , TYPE = NOLOAD
IQmathTables2: > FLASH, PAGE = 0 , TYPE = NOLOAD
FPUmathTables: > FLASH, PAGE = 0 , TYPE = NOLOAD
}
-l "C:\Program Files\MATLAB\R2009a\toolbox\rtw\targets\ccslink\ccslink\c2000\c2833xPeripherals.cmd"
文章评论(0条评论)
登录后参与讨论