This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

cmd文件问题

这几天在做语音信号的时域分析基于DSP5509实现的实验时,工程编译通过,没有错误,但有两个警告。下载程序无法成功,以下是具体情况描述。

1、编译警告

(1)、Severity and Description Path Resource Location Creation Time Id   creating ".stack" section with default size of 0x3e8; use the -stack option to change the default size audio_fir line 0 1467274960686 430

(2)、Severity and Description Path Resource Location Creation Time Id   creating ".sysstack" section with default size of 0x3e8; use the -sysstack option to change the default size audio_fir line 0 1467274960686 431

2、程序下载时出现的问题:

C55xx: GEL Output: C5509A Init Complete.
C55xx: File Loader: Data verification failed at address 0x00FFFF00 Please verify target memory and memory map.
Error found during data verification.
Ensure the linker command file matches the memory map.

警告暂时还不明白是什么问题。程序下载不成功,提示自己的内存映射不对,但是这一块暂时不知道该怎么改。下面是我工程的cmd文件内容,各位路过的牛人、老师知道的话,谢谢你们指点一二。

-w
-lrts55x.lib
MEMORY
{
PAGE 0:

MMR : origin = 0000000h, length = 00000c0h
SPRAM : origin = 00000c0h, length = 0000040h
DARAM0 : origin = 0000100h, length = 0003F00h
DARAM1 : origin = 0004000h, length = 0004000h
DARAM2 : origin = 0008000h, length = 0004000h
DARAM3 : origin = 000c000h, length = 0004000h

SARAM0 : origin = 0010000h, length = 0004000h
SARAM1 : origin = 0014000h, length = 0004000h
SARAM2 : origin = 0018000h, length = 0004000h
SARAM3 : origin = 001c000h, length = 0004000h
SARAM4 : origin = 0020000h, length = 0004000h
SARAM5 : origin = 0024000h, length = 0004000h
SARAM6 : origin = 0028000h, length = 0004000h
SARAM7 : origin = 002c000h, length = 0004000h
SARAM8 : origin = 0030000h, length = 0004000h
SARAM9 : origin = 0034000h, length = 0004000h
SARAM10 : origin = 0038000h, length = 0004000h
SARAM11 : origin = 003c000h, length = 0004000h
SARAM12 : origin = 0040000h, length = 0004000h
SARAM13 : origin = 0044000h, length = 0004000h
SARAM14 : origin = 0048000h, length = 0004000h
SARAM15 : origin = 004c000h, length = 0004000h

CE0 : origin = 0050000h, length = 03b0000h
CE1 : origin = 0400000h, length = 0400000h
CE2 : origin = 0800000h, length = 0400000h
CE3 : origin = 0c00000h, length = 03f8000h

PDROM : origin = 0ff8000h, length = 07f00h
VECS : origin = 0ffff00h, length = 00100h /* reset vector */
}


SECTIONS
{
vectors : {} > VECS PAGE 0 /* interrupt vector table */
.cinit : {} > SARAM0 PAGE 0
.text : {} > SARAM1 PAGE 0
isrs : {} > SARAM2 PAGE 0

.stack : {} > DARAM0 PAGE 0
.sysstack: {} > DARAM0 PAGE 0
.sysmem : {} > DARAM1 PAGE 0
.data : {} > DARAM1 PAGE 0
.bss : {} > DARAM1 PAGE 0
.const : {} > DARAM1 PAGE 0

.coeffs : {} > DARAM2 PAGE 0
.dbuffer : {} > DARAM3 PAGE 0
files : {} > DARAM2 PAGE 0 /* User-defined sections */
statvar : {} > DARAM2 PAGE 0
statarry : {} > DARAM2 PAGE 0
tempvar : {} > DARAM2 PAGE 0
temparry : {} > DARAM2 PAGE 0
sounds : {} > SARAM3 PAGE 0
}

  • 1.这两个warning提示你没有定义stack和sysstack的大小,编译器使用的是默认值,如果默认值大小对你的代码来说足够的话,可以忽略此warning。

    2. 从cmd文件看, VECS 放到了0ffff00段,请问MPNMC是1还是0?如果是0的话,这段memory是映射到ROM, 只读memory, 程序load不了,会报错。

  • 首先,谢谢你的回复。

    1、第一个问题,两个警告问题已经解决了。

    2、MPNMC是寄存器ST3_55中的第6位,,但是我不知道在哪里设置它,或者说该怎么修改呢?

    盼复

  • 首先,谢谢你的回复。

    1、第一个问题,两个警告问题已经解决了。

    2、MPNMC是寄存器ST3_55中的第6位,,但是我不知道在哪里设置它,或者说该怎么修改呢?

    盼复

  • 直接修改ST3_55中的MPNMC位。参考下面的文档第99页。

    BCLR MPNMC ; Clear MPNMC
    BSET MPNMC ; Set MPNMC


    http://www.ti.com/lit/ug/spru371f/spru371f.pdf 

  • 你好,我程序能下载进去了,但是又出现新的问题了

    1、点击F5,单步调试就会报如下的错误。

    C55xx: GEL Output: C5509A Init Complete.

    C55xx: Trouble Reading Memory Block at 0x14037 on Page 0 of Length 0x16: Error 0x00000002/-1146 Error during: Memory, Invalid data was scanned by the emulation controller. Verify the board setup to make sure the scan chain is properly defined. If the setup is correct, then RESET EMULATOR. This will disconnect each target from the emulator. The targets should then be power cycled or hard reset followed by an emureset and reconnect to each target.

    C55xx: Failed to remove the debug state from the target before disconnecting. There may still be breakpoint op-codes embedded in program memory. It is recommended that you reset the emulator before you connect and reload your program before you continue debugging

    2、直接点击运行,程序能运行,但是点击停止后,程序没有停止。

    3、我现在用的就是TI例程中codec这个例子,修改的部分如下所示:

    /*回放音频*/
    while(TRUE)
    {

    for(i=0;i<5;i++) 
    {
    while(!MCBSP_rrdy(hMcbsp)){};

    aic23data = 5000;
    MCBSP_write16(hMcbsp,aic23data); 
    delay(3000);


    aic23data = 0;
    MCBSP_write16(hMcbsp,aic23data); 
    delay(3000);
    }
    };

  • 例程修改前能正常运行吗?

  • 修改前是可以运行的,给的例程中这一部分代码是这样的:

    /*回放音频*/
            while(TRUE)
            {
                    while(!MCBSP_rrdy(hMcbsp)){};
                    //aic23data = MCBSP_read16(hMcbsp);         
                    aic23data = 5000;
                    for(temp=30000;temp>0;temp-=100)
            {
                           for(i=0;i<2;i++)
                          {
                             aic23data = 5000;
                             MCBSP_write16(hMcbsp,aic23data);       
                             delay(temp);
                             aic23data = 0;
                             MCBSP_write16(hMcbsp,aic23data);        
                             delay(temp);
                            }
                   }
                   //MCBSP_write16(hMcbsp,aic23data);         
            }; 
    我现在改的部分如下:

    /*回放音频*/
    while(TRUE)
    {

    for(i=0;i<5;i++) 
    {
    while(!MCBSP_rrdy(hMcbsp)){};

    aic23data = 5000;
    MCBSP_write16(hMcbsp,aic23data); 
    delay(3000);


    aic23data = 0;
    MCBSP_write16(hMcbsp,aic23data); 
    delay(3000);
    }
    };

  • 把stack, heap size加大试试。

  • 1、我在想是不是PC机操作系统的原因,因为我现在用的win10系统。不知道这个有影响没有,因为我在跑TI例程时,如果操作过快,也会导致CPU报错。

    2、我想把例程改成实现语音的实时回放,麦克风输入语音,耳机再放出来,我看了有人这样改成功了的,自己修改的代码如下:

     while(TRUE)
            {
                    while(!MCBSP_rrdy(hMcbsp)){};                
                    aic23data = MCBSP_read16(hMcbsp);
                    //for(temp=300;temp>0;temp--);
                    delay(3000);
                    while(!MCBSP_xrdy(hMcbsp)){};
                    MCBSP_write16(hMcbsp,aic23data);
            };    

    耳机听到的全是噪音,而且程序无法停止。

  • 请问你现在用的CCS版本是多少?

  • 1、现在用的是CCS4.2+win10

    2、我这样写有什么问题么?

     while(TRUE)
            {
                    while(!MCBSP_rrdy(hMcbsp)){};                
                    aic23data = MCBSP_read16(hMcbsp);
                    //for(temp=300;temp>0;temp--);
                    delay(3000);
                    while(!MCBSP_xrdy(hMcbsp)){};
                    MCBSP_write16(hMcbsp,aic23data);
            };    

  • 1. CCSv4.2不支持win10的,用最新的ccs v6.1.3

    2. 这个估计是codec配置方面的问题,你抓 一点数据看看。

  • 好的,谢谢了。

    我把stack, heap size加大后,现在可以调试了。只是偶尔CPU还是会报错。

  • 你好,我现在从AIC23采集到的数据始终都在负半轴,放在数组里观察也是为负数。按理说mcbsp从AIC23的A/D读回来的数据应该是正、负都有才对,请问这是怎么回事呢?还是我理解错了。。。下面是截取的测量图形。

  • 请问一下,这是什么原因啊。我也遇到了这个问题,所有的数据都是负数,很奇怪。求请教。
  • 你好,从AIC23采集到的数据始终都在负半轴,放在数组里观察也是为负数。按理说mcbsp从AIC23的A/D读回来的数据应该是正、负都有才对,请问这是怎么回事呢?