一丝执念 发表于 2013-8-19 20:51

TMS320C6713片内SRAM的容量

今天调试的时候发现,当把程序下载到片内RAM的30000h--40000h内时CCS3.3提示内存不可写。请问这是为什么?
上电复位后,默认的状态不就是256K(字节)的片内SRAM么?怎么后面(可配置成cache)的部分不能用么?

zhangmangui 发表于 2013-8-19 22:37

是不是与HD的电平有关系
DSP上电复位后,QDMA自动从CE1空间拷贝1KB数据(引导代码应定位于此)到地址0处,然后从0地址处开始执行引导代码指令.本引导代码的主要功能是将用户程序段从Flash复制到DSP内部RAM中,然后再跳转到程序 的入口处开始执行主程序.

一丝执念 发表于 2013-8-20 09:33

HD在调试的时候我使之为“0:0”,版主后面说的bootloader部分貌似和我问题没关系,可能是我上面的描述不清楚?我把CMD文件贴出来(以合众达开发板为例子):
MEMORY
{
        PMEM:        o = 00000000h        l = 00010000h
        BMEM:        o = 0003000h        l = 00000100h
}

SECTIONS
{   
    .text       >   PMEM
    .csldata        >         PMEM
    .stack        >   PMEM
    .far        >   PMEM
    .switch        >   BMEM
    .tables >   BMEM
    .data   >   BMEM
    .bss        >   BMEM
    .sysmem        >   BMEM
    .cinit        >   PMEM
    .const        >   BMEM
    .cio    >   BMEM
}
同样的程序这个CMD配置生成的可执行文件下载到DSP上时CCS提示“Loader: One or more sections of your program falls into a memory region that is not writable,These regions will not actually be written to the target”
只要把“        BMEM:        o = 0003000h        l = 00000100h ”改为“        BMEM:        o = 000200h        l = 00000100h '就没问题,也就是说程序系在到30000到40000这个地址后会提示错误。而这个地址范围刚好是cache部分,但是我让这个部分用作SRAM了啊,怎么还不用下载程序么?

一丝执念 发表于 2013-8-20 11:07

找到原因了:
setup_memory_map()
{
       
        GEL_MapOn();            
        GEL_MapReset();         
       
        /* On-chip memory map */
        GEL_MapAdd(0x00000000,0,0x00040000,1,1); /* Internal RAM (L2) mem    */
        GEL_MapAdd(0x01800000,0,0x00000024,1,1); /* EMIF control regs      */
        GEL_MapAdd(0x01840000,0,0x00000004,1,1); /* Cache configuration reg*/
        GEL_MapAdd(0x01844000,0,0x00000020,1,1); /* L2 base addr & count regs*/
        GEL_MapAdd(0x01844020,0,0x00000020,1,1); /* L1 base addr & count regs*/
        GEL_MapAdd(0x01845000,0,0x00000008,1,1); /* L2 flush & clean regs    */
        GEL_MapAdd(0x01848200,0,0x00000010,1,1); /* CE0 mem attribute regs   */
        GEL_MapAdd(0x01848240,0,0x00000010,1,1); /* CE1 mem attribute regs   */
        GEL_MapAdd(0x01848280,0,0x00000010,1,1); /* CE2 mem attribute regs   */
        GEL_MapAdd(0x018482c0,0,0x00000010,1,1); /* CE3 mem attribute regs   */
        GEL_MapAdd(0x01880000,0,0x00000004,1,1); /* HPI control reg          */
        GEL_MapAdd(0x018c0000,0,0x00000028,1,1); /* McBSP0 regs            */
        GEL_MapAdd(0x01900000,0,0x00000028,1,1); /* McBSP1 regs            */
        GEL_MapAdd(0x01940000,0,0x0000000c,1,1); /* Timer0 regs            */
        GEL_MapAdd(0x01980000,0,0x0000000c,1,1); /* Timer1 regs            */
        GEL_MapAdd(0x019c0000,0,0x0000000c,1,1); /* Interrupt selector regs*/
        GEL_MapAdd(0x019c0200,0,0x00000004,1,1); /* Device configuration   */
.......
......
......
GEL中setup_memory_map()的第一行即“        GEL_MapAdd(0x00000000,0,0x00040000,1,1); /* Internal RAM (L2) mem    */”我设置错了,以前0x00040000设置成了0x00030000。
贴出来,希望大家不要犯我这样的错了哈

zhangmangui 发表于 2013-8-20 15:09

一丝执念 发表于 2013-8-20 11:07 static/image/common/back.gif
找到原因了:
setup_memory_map()
{


感谢你的分享   
页: [1]
查看完整版本: TMS320C6713片内SRAM的容量