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.

Trouble Halting Target CPU

I have attached my  project. The .out for this loads and runs. If I try to halt, the following error comes:

Failed to remove the debug state from the target before disconnecting.  There may still be breakpoint opcodes embedded in program memory.  It is recommended that you reset the emulator before you connect and reload your program before you continue debugging.
Trouble Halting Target CPU: Error 0x00000022/-2130 Error during: Memory, Execution,  Cannot access memory address at 0x00000800   Sequence ID: 15 Error Code: -2130 Error Class: 0x00000022

Please help.5417.5509SPI.rar

  • Hi,

    The error message indicates the CPU is locked somehow and the emulator cannot get control of it. This can be caused by several factors like code that puts the processor in a unstable state (bad PLL configuration, etc), a bus contention that prevents the core to receive code or data and, more rarely, burst of high priority interrupt requests that clog the CPU or very tight loops that can create a bus contention.

    When you say the .out "loads and runs" you mean it is behaving as expected? If not, then I would really recheck all the PLL configurations (sorry, I am not a 5509 expert to help you) and hardware initialization routines. You can step-by-step during the PLL initialization and see if a specific instruction is throwing your CPU away.

    If your code is behaving as expected when the CPU is running free, then I would try to put a breakpoint in your code and see if the execution stops there.

    One thing that worries me a bit is the tight loop where the functions MCBSP_write16() and delay_loop() are. Can you try to put one or a few inline assembly asm("  nop"); in the delay_loop() function? This will delay the loop cycle a bit and allow you to put a breakpoint to test the execution.

    Unfortunately I don't have a board with me to thoroughly test your project, but I will try to get one. In the meantime please let me know the results of the suggestions above, ok?

    Hope this helps,

    Rafael

     

  • I experienced similar troubles, what desouza rafael said its true, what i did was to click pause button, restart my tiva and tried again, it worked. hope to be helpful.