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.

CCS/TMS320C5515: Cannot reset CPU registers, followed by error connecting to the target

Part Number: TMS320C5515

Tool/software: Code Composer Studio

CCS version: 7.1.0.00015 

Platform: ezDSP dev board with C5515 (on board XDS100v2 emulator/debugger)

OS: Ubuntu 17.04

I'm connecting to the ezDSP board via a USB cable. There's nothing else connected to the board, no power, no SD card, nothing.

I've been going through a cycle of programming/debugging/etc. successfully for weeks now, but now I'm trying more complicated things I've suddenly encountered a problem. When trying to debug a program, I can't get the registers on the C5515 to revert to their reset state.

For example, looking at the register browser, the DMA transfer status (DMACH0TCR2 STATUS) seems "stuck" at 1 - no matter how many times I reset, restart, reprogram or even unplug and replug the USB cable. Same for the CPU register BERR (bus error).

I have stripped my code down to nothing more than:

int main(void) { return 0 }

I try resetting the CPU, restarting it, filling the memory with 0. I've also tried writing firmware to write to certain registers to reset them, but nope. Changing them in the GUI doesn't have any effect, the GUI control just resets to the unwanted register value. Here's a screenshot of what I mean:

Sometimes the code runs. In my "empty main" example, it just runs to the end of main. In more complicated code, I can step through until I do something that relies on these registers (eg. wait for DMA activity to stop, or USB clock stop ACK) and then the code acts as though the register is set to the value I see... which makes sense, but it suggests that it's not just that CCS is showing the wrong value or that the XDS is mistaken; the registers must really be set to those values. It's as though the CPU reset and even a power cycle does not actually make those registers revert to their expected post-reset state.

If I mess around with CCS enough, either it'll freeze up totally or I'll get the error:

Error connecting to the target:

(Error -1138 @ 0x5F)

Device refused to allow debug mode. Power-cycle the board. If error persists, confirm configuration and/or try more reliable JTAG settings (e.g. lower TCLK).

(Emulation package 6.0.576.0)

Note also that if I power it off (by disconnecting USB) and plug it back in, it starts up with some strobing lights and LCD scrolling text - not code that I've ever written. Presumably the ezDSP starts up by loading some program off external memory into the C5515... could this be messing with the registers?

Anyway, I'm at a total loss as to what to do. Unfortunately I don't have other boards to test against. How do I proceed? How can I get the CPU to reset all of its registers to their post-reset values?

  • The problem was I'd misconfigured the project as bare TMS320C5515 project instead of a USBSTK5515 project. Under the hood, Code Composer Studio loads the appropriate GEL files that tell it how to communicate with the emulator/debugger and how to initialise the device it's debugging.

    I fixed it by manually changing the project properties, under General > Main > Device.

    Then I also went into the debug perspective (don't launch the debug target by clicking on the bug icon, but just open the perspective by clicking on the combination bug/cube icon, usually in the top right).

    Then under Window > Show View > Target Configurations > Projects > (Your project) > targetConfigs there should be a USBSTK5515.ccxml entry. Open that, click on the advanced tab down the bottom, and there should be an entry Texas Instruments XDS100v2 USB Debug Probe > USBSTK5515 > TMS320VC5515_0 > C55x. The window on the right has a box for "Initialization script", and it should be "../../emulation/boards/usbstk5515_v1/gel/usbstk5515.gel".

    Phew.

  • Oh, and sorry if my accidental pasting of a heap of code in my first post confused anyone. It's gone now.
  • Hi Jason,

    Thank you for sharing decision for your issue.

    BR
    Tsvetolin Shulev