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/TM4C1230C3PM: Debugging Errors

Part Number: TM4C1230C3PM


Tool/software: Code Composer Studio

Hello,

I'm working with the MCU indicated in the title and CCS V7.2.

I am in a debug session when my code gets to a while(1) loop that evaluates and updates timer services.

while(1){

Tmr_Srv_Routine();

}

If I "Step Over" this code repeatedly (F6) there is now problem. But when I use the "Resume" functionality (F8) I get an error:

CORTEX_M4_0: Can't Run Target CPU: (Error -1268 @ 0x1090001) Device is locked up in Hard Fault or in NMI. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 6.0.628.3) 

and after a few seconds I also get:

CORTEX_M4_0: Can't Run Target CPU: (Error -1268 @ 0x1090001) Device is locked up in Hard Fault or in NMI. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 6.0.628.3)

I should mention I am new to CCS and I could have very well missed something small but I've been chasing this error for some time now. Any suggestions would be well appreciated.

  • I'm sorry, the second fault shouldn't be a duplicate of the first and should read:

    CORTEX_M4_0: JTAG Communication Error: (Error -1170 @ 0x0) Unable to access the DAP. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 6.0.628.3)
    CORTEX_M4_0: 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
  • Hi,

    The first error is the trigger to the second one. In other words, the code that is running is causing the device to be locked in a Hard Fault or a non-masked interrupt and can't recover or be controlled by the JTAG Debug Probe.

    The reasons for the code to be causing this varies widely: either bad interrupt service routines that may not be returning properly (it does not seem to be the case as step operations seem to work fine), too many interrupts that are being nested or occur too frequently so they may cause a stack overflow (that would be evidenced only when the code is running free), and others.

    In this case, you can use the ARM Advanced features (menu Tools --> ARM Advanced Features) and enable the Vector Catch breakpoints - they will break the device execution at the first occurrence of any of the exceptions, which will help you verify the status of the system at the time.

    For further analysis of your code you will have to double-check with the device experts on the TM4C forum.

    Hope this helps,
    Rafael
  • Hi Desouza,

    My problem was using the wrong debugger configuration. The wrong one was erasing my flash then trying to reload older code that was then trying to write to the JTAG pins.

    Thanks for the suggestion on the ARM Advanced Features, I'll keep that tool in mind for the future.