2017-04-23 09:02 AM
I started to debug the STM32 project using
STSW-LINK009 (V1.02)
Checking the ST_Link Debug Properties, it show 2013-12-10, version 1.1.0.0
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 haltedPolling target stm32f4x.cpu failed, trying to reexamineExamination failed, GDB will be halted. Polling again in 100msInfo : Previous state query failed, trying to reconnectPolling target stm32f4x.cpu failed, trying to reexamineInfo : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpointsBut 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
2017-04-23 09:46 AM
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.
2017-04-23 02:30 PM
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
2017-04-23 02:51 PM
With more review, I do have an error but it allows me to continue
adapter speed: 2000 kHz
adapter_nsrst_delay: 100srst_only separate srst_nogate srst_open_drain connect_assert_srstsrst_only separate srst_nogate srst_open_drain connect_assert_srstInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : Unable to match requested speed 2000 kHz, using 1800 kHzInfo : clock speed 1800 kHzError: libusb_open() failed with LIBUSB_ERROR_NOT_SUPPORTEDInfo : STLINK v2 JTAG v28 API v2 M v18 VID 0x0483 PID 0x374BInfo : using stlink api v2Info : Target voltage: 3.241334Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpointsInfo : accepting 'gdb' connection on tcp/3333adapter speed: 1800 kHzstm32f4x.cpu: target state: haltedtarget halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x08000a38 msp: 0x20020000configuring PLL