Skip to main content
Dilbert K
Associate III
April 23, 2017
Question

Error: jtag status contains invalid mode value - communication failure

  • April 23, 2017
  • 1 reply
  • 3592 views
Posted on April 23, 2017 at 18:02

I started to debug the STM32 project using

  • NUCLEO-F411RE board
  • AC6 System Workbench (win_64bits-v1.14.0)
  • STM32Cube_FW_F4_V1.15.0 (example to Blink LED on board)
  • STSW-LINK009 (V1.02)

    • Checking the ST_Link Debug Properties, it show 2013-12-10, version 1.1.0.0

    • Is this correct ??
  • OpenOCD (stlink-v2.cfg)

I could connect,load & run the code 

---> Stop at Main()

stm32f4x.cpu: target state: halted

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

xPSR: 0x01000000 pc: 0x08000a38 msp: 0x20020000

---> After few minutes

Error: jtag status contains invalid mode value - communication failure

Warn : target stm32f4x.cpu is not halted

Polling target stm32f4x.cpu failed, trying to reexamine

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

Info : Previous state query failed, trying to reconnect

Polling target stm32f4x.cpu failed, trying to reexamine

Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints

But the GBD will be disconnected after few minutes.  The firmware on the board is still running.

If I click 'Resume', it will continue. 

But after a few minutes, it will have above error again.

Warn : WARNING! The target is already running. All changes GDB did to registers will be discarded! Waiting for target to halt.

Anyone has any ideas to share ?  Thanks

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    April 23, 2017
    Posted on April 23, 2017 at 18:46

    The driver is fine, it just facilitates connectivity, the complex interactions in this case are in OpenOCD, and it is there that you need to look. The source code is available, you should perhaps dig into the repository and mailing list to better understand the issue and potential remedies.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Dilbert K
    Dilbert KAuthor
    Associate III
    April 23, 2017
    Posted on April 23, 2017 at 21:30

    I got more update after trying the IAR which I installed for trial.

    Result is the same.... so it must be STLink or STdebug driver setting (I am using Window 10)

    I double check the Firmware for STLink, which is latest

    stsw-link007V2J28M18RC2

    Dilbert K
    Dilbert KAuthor
    Associate III
    April 23, 2017
    Posted on April 23, 2017 at 21:51

    With more review, I do have an error but it allows me to continue

    adapter speed: 2000 kHz

    adapter_nsrst_delay: 100

    srst_only separate srst_nogate srst_open_drain connect_assert_srst

    srst_only separate srst_nogate srst_open_drain connect_assert_srst

    Info : Unable to match requested speed 2000 kHz, using 1800 kHz

    Info : Unable to match requested speed 2000 kHz, using 1800 kHz

    Info : clock speed 1800 kHz

    Error: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTED

    Info : STLINK v2 JTAG v28 API v2 M v18 VID 0x0483 PID 0x374B

    Info : using stlink api v2

    Info : Target voltage: 3.241334

    Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints

    Info : accepting 'gdb' connection on tcp/3333

    adapter speed: 1800 kHz

    stm32f4x.cpu: target state: halted

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

    xPSR: 0x01000000 pc: 0x08000a38 msp: 0x20020000

    configuring PLL