原创 DSP开发之CMD文件配置问题总结

2011-6-8 09:31 6828 11 11 分类: 处理器与DSP

(1)程序烧写到DSP片内FLASH内后,运行正常,串口发送字符正常。断开仿真器,重新下电,上电后,串口发送字符乱码。

    问题分析:CMD文件配置问题,导致关键参数配置到内部RAM中去,掉电后丢失。

    问题原因:CMD文件中,econst:  > RAML0L3, PAGE = 1,配制成了RAM,导致掉电后上电串口发送乱码。更改为.econst: > FLASH, PAGE = 0后,程序运行正常,串口发送字符正常。

    .econst:是在使用大存储器模式时使用的,包括字符串,声明,以及被明确初始化过的全局变量和静态变量,可以放在数据页得任何地方。

CMD文件如下:

MEMORY
{
PAGE 0:
    BEGINRAM:  origin=0x0, length=0x2
    RAMM0:  origin=0x2, length=0x3fe
    OTP:  origin=0x380400, length=0x400
    FLASH:  origin=0x300000, length=0x3fff6
    BEGINFLASH:  origin=0x33fff6, length=0x2
    CSM_PWL:  origin=0x3f7ff8, length=0x8
    IQTABLES:  origin=0x3fe000, length=0xb50
    IQTABLES2:  origin=0x3feb50, length=0x8c
    FPUTABLES:  origin=0x3febdc, length=0x6a0
    ROM:  origin=0x3ff27c, length=0xd44
    RESET:  origin=0x3fffc0, length=0x2
    VECTORS:  origin=0x3fffc2, length=0x3e
    RAML4L7:  origin=0xc000, length=0x4000
    ADC_CAL:  origin=0x380080, length=0x9
PAGE 1:
    RAML0L3:  origin=0x8000, length=0x4000
    RAMM1:  origin=0x400, length=0x400
}

SECTIONS
{
    .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条评论)

登录后参与讨论
我要评论
0
11
关闭 站长推荐上一条 /2 下一条