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.

Can't Single Step Target Program,Trouble Reading Memory Block,这些错误是由啥引起的?

Other Parts Discussed in Thread: TMS320C5517

C55xx: Can't Single Step Target Program: Error 0xA0000022/-1138 Error during: Memory, Execution, Processor aborted debug context.
C55xx: Trouble Reading Memory Block at 0x4008 on Page 2 of Length 0x1: Error 0x80000002/-1143 Fatal Error during: Memory, The memory at 0x00008010 continually indicated it was 'not ready' All memory operations currently in progress were aborted in order to regain control of the processor. This is considered a catastrophic event, but the debugger should still be able to access memory and CPU registers. System state has been altered. It is strongly advised that the processor should be reset before resuming execution,
C55xx: Can't Single Step Target Program: Error 0x80000022/-1138 Fatal Error during: Memory, Execution, Processor aborted debug context.
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

这个错误导致我不能进行MCBSP的初始化?

这个实在C5517evmsupport.spectrumdigital.com/.../中led那个例程的基础上实现的;

Peripheral Clock Gating Control Register

针脚复用也设置了,但是这个程序就是不能单步运行,连续运行,也会在这卡,然后,在运行,才会运行完,但是功能没有实现。

void mcbsp_Init()
{
SPCRL = 0x0000; //RRST=0,Receiver in reset
PCRL = 0x0f00; //FSXM=CLKXM=1,发送时钟和帧同步由内部驱动
//FSRM=CLKRM=1,接收时钟和帧同步由内部驱动
SRGRL = 0x0103; //设置发送时钟速率
//CLKGDV=3;SRG输出时钟4分频
//FWID=1;帧同步脉冲的脉宽为2个CLKG周期
SRGRU = 0x3011; //CLKSM=1;选择CPU时钟为参考时钟
//FSGM=1;采用FSG做内部帧同步驱动
//FPER=17
//发送控制寄存器
XCRL = 0x0040; //对发送控制寄存器1进行设置
//XFRLEN1[14:8]=0000000,帧长为一个字
//XWDLEN1[7:5]=010,字长为16bits
XCRU = 0x0001; //对发送控制寄存器2进行设置
//XPHASE=0,每帧一个阶段;
//XDATDLY=01,发送时1比特延迟
//接收控制寄存器
RCRL = 0x0040; //对接收控制寄存器1进行设置
//RFRLEN1[14:8]=0000000,帧长为一个字
//RWDLEN1[7:5]=010,字长为16bits
RCRU = 0x0001; //对接收控制寄存器2进行设置
//RPHASE=0,每帧一个阶段;
//RDATDLY=01,发送时1比特延迟
//多通道控制寄存器
MCRL = 0x0001; //对多通道控制寄存器1进行设置
//无需多个通道。RMCM=1,不使能所有接收通道
MCRU = 0x0001; //对多通道控制寄存器2进行设置
//XMCM=1,不使能所有发送通道

SPCRU = 0x0040; //GRST=1,启动采样速率发生器。
SPCRU = 0x00c1; //FRST=1,启动帧同步
//XRST=1,启动发送器
SPCRL = 0x0001; //RRST=1,启动接收器
}

  • 请问是EVM板还是自己的板子?是跑到哪块代码出现这个问题?

  • 是C5517EVM,代码是在正常的代码上(意思是这个代码能跑,没问题),加上McBSP的初始化,结果一跑到初始化就出错了。只要一涉及MCBSps的寄存器就出错。

  • 请看一下EBSR寄存器的值?mcbsp和i2s, gpio, mmc接口是管脚复用的,在使用前需要在EBSR寄存器里先设置成mcbsp功能,具体请参考下面的EBSR介绍。

    5.7.3.5.1 External Bus Selection Register (EBSR)
    http://www.ti.com/lit/ds/symlink/tms320c5517.pdf

  • 这个我注意到了,也配置好了,但是还是不行,上面的错误就是我管脚复用配置好后的错误提示。

    /* Enable clocks to all peripherals */
    SYS_PCGCR1 = 0x0000;
    SYS_PCGCR2 = 0x0000;
    /* Configure Serial Port 0 */
    SYS_EXBUSSEL &= ~0x0300; //
    SYS_EXBUSSEL |= 0x8300; // Enable McBSP pins
    SYS_PRCNTRLR &= ~0x0040; // Make sure McBSP is out of reset

    这些设置都有啊,但是还是有问题啊。

  • 看了一下EVM板的原理图,mcbsp管脚没有引出来,怎么判断功能没有实现?

  • 多谢了!

    这个测试功能不是使用loop back功能吗?

    还有这个问题我曾经测试UART的时候也遇到过,当时没注意,没想到MCBSP又出现了这个问题。通过反复查找,发现是两个寄存器没有配置。

    Peripheral Clock Stop Request/Acknowledge Register 1 (CLKSTOP1)

    Peripheral Clock Stop Request/Acknowledge Register 2 (CLKSTOP2)

    #define preg1 *(volatile ioport Uint16*)(0x1c3a)
    #define preg2 *(volatile ioport Uint16*)(0x1c3b)

    preg1 = 0;
    preg2 = 0;

    当把这两个寄存器配置好后,就可以读取或写入寄存器了。

    但是这个寄存器默认值就是零啊,问什么还要重新配置为零。

    最后,配置完成,loop back模式没成功,即数据发出去,但是接收不到,是因为管脚没引出来的问题?

    谢谢回答了

  • 1. 可以查一下在配置前,CLKSTOP1, CLKSTOP2的值是不是为0?

    2. LPBK设成1了吗?用DLB模式的话,跟管脚引不引出来没关系。