Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


[resolved] Failing debug on a Nucleo-F103RB

Hi everyone,

I have an issue trying to debug my project. I use sw4stm32 (2.3) on a windows 10. My board is a Nucleo-F103RB configured thanks to stm32cubemx (4.23).

Configuring, compiling, running the project on the board works fine, but there’s an issue when I try to debug it, as you can see on the report downstairs. Afterwards, the programming led turns orange.

The weird thing is that it used to work couple of weeks ago. I have tried different configurations using another computer (windows 7) and another board (Nucleo-L053R8), but the problem remains the same.

I updated the stlink firmwork, tried couple of things I found on other threads, but I can’t solve my problem.

Do you see what I’m doing wrong?

Regards,

Cedric.

=====
OpenOCD child process termination

Reason:
Unplugged target during debug session

- Details -

Unplugged target during debug session
Open On-Chip Debugger 0.10.0-dev-00005-g4030e1c-dirty (2017-10-24-08:00)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.htmlQuestion
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter_nsrst_delay: 100
adapter speed: 950 kHz
Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 950 kHz
Info : STLINK v2 JTAG v29 API v2 M v18 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 58.019050
Info : Stlink adapter speed set to 950 kHz
Info : STM32F103RBTx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080012f0 msp: 0x20005000
Info : Stlink adapter speed set to 4000 kHz
adapter speed: 4000 kHz
Info : device id = 0x20036410
Info : flash size = 128kbytes
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080012f0 msp: 0x20005000
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080012f0 msp: 0x20005000
Info : Stlink adapter speed set to 4000 kHz
adapter speed: 4000 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x2000003a msp: 0x20005000
Info : Stlink adapter speed set to 950 kHz
adapter speed: 950 kHz
STM32F103RBTx.cpu: target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080012f0 msp: 0x20005000
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: JTAG failure -4
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F103RBTx.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 STM32F103RBTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 300ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F103RBTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 700ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F103RBTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 1500ms
Info : Previous state query failed, trying to reconnect
Error: jtag status contains invalid mode value - communication failure
Polling target STM32F103RBTx.cpu failed, trying to reexamine
Examination failed, GDB will be halted. Polling again in 3100ms
shutdown command invoked


Info : dropped ‘gdb’ connection

Hi,

There was an issue on F1 projects with CubeMx, by default, i think the SWD was disabled.

To enable SWD debug on STM32F1 devices, you need to configure in the cubeMx the “Pinout -> SYS -> Debug -> Serial Wire”.
Have you done that ?

And then try again to debug.

Rgds,
Laurent

That’s it!

You were right, the ‘SYS Debug option’ on CubeMX is off by default. It seems to work so far, thanks a lot Laurent.

Regards,

Cedric.


 

Newest Forum Posts

  1. Монтаж камина с грилем в Москве - установка и барбекю by KpddomErorb, 2025-05-10 18:28
  2. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  3. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  4. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  5. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  6. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  9. Build a project in "release" mode by tang, 2025-02-20 10:36
  10. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35

Last-Modified Blogs