cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo Debugging: jtag status contains invalid mode value - communication failure

Lars Beiderbecke
Senior III
Posted on February 25, 2018 at 11:43

For the past months I've been working with my STM32F722ZE Nucleo board without any issues.  But a few days ago debugging suddenly broke.  I can still create a session, but when the debugger hits a breakpoint (I assume), I only get this error message (at the end of the log):

Info : STM32F722ZETx.cpu: hardware has 8 breakpoints, 4 watchpoints

Info : accepting 'gdb' connection on tcp/3333

Info : Stlink adapter speed set to 1800 kHz

adapter speed: 1800 kHz

STM32F722ZETx.cpu: target state: halted

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x080059d4 msp: 0x20040000

Info : Stlink adapter speed set to 4000 kHz

adapter speed: 4000 kHz

Info : flash size probed value 512

Info : flash size probed value 512

Info : Stlink adapter speed set to 1800 kHz

adapter speed: 1800 kHz

STM32F722ZETx.cpu: target state: halted

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x080059d4 msp: 0x20040000

Info : Stlink adapter speed set to 1800 kHz

adapter speed: 1800 kHz

STM32F722ZETx.cpu: target state: halted

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x080059d4 msp: 0x20040000

Info : Stlink adapter speed set to 4000 kHz

adapter speed: 4000 kHz

STM32F722ZETx.cpu: target state: halted

target halted due to breakpoint, current mode: Thread

xPSR: 0x61000000 pc: 0x20000084 msp: 0x20040000

Info : Stlink adapter speed set to 1800 kHz

adapter speed: 1800 kHz

STM32F722ZETx.cpu: target state: halted

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x080059d4 msp: 0x20040000

Error: jtag status contains invalid mode value - communication failure

Warn : target STM32F722ZETx.cpu is not halted

Polling target STM32F722ZETx.cpu failed, trying to reexamine

Examination failed, GDB will be halted. Polling again in 100ms

Info : Previous state query failed, trying to reconnect

...

Error: jtag status contains invalid mode value - communication failure

Polling target STM32F722ZETx.cpu failed, trying to reexamine

Examination failed, GDB will be halted. Polling again in 6300ms

shutdown command invoked   (<--- stopped debug)

Info : dropped 'gdb' connection

While this is happening, the Nucleo connection LED shows both green and orange at the same time (not blinking).

My setup for SYS is 'trace async with SW', and those three pins are unconnected/unused but configured.

What is causing this?  Google did not provide an answer.

#debug #error
1 REPLY 1
Lars Beiderbecke
Senior III
Posted on February 26, 2018 at 17:45

Small update: Breakpoints on code that is regularly called my main.c work just fine. The above problems only occur on interrupt handlers (unless there is some hidden timing issue)!

My debug configuration should also be fine: connect under reset, SWD, 4 MHz (tried lower as well), enable debug for low power.