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


Newbie trouble. Debug my own board via ST-LINK-V2 in Discovery

Hello, there!
I use stm32l-discovery (with st-link/v2) with my own board. I connect via SWD (SWIO SWCLK) chip STM32F100C4T6B.
I generate first project from STM32CubeMX.
In Ac6 set in debug options my ST-LINK/V2.

Build is normal. I have a .elf file
In code navigator set breakpoint after main function in neverend while part.
When I try to debug, i get error (attach1) and next console output:
------------------------

Info : STM32F100C4Tx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
Error: timed out while waiting for target halted
TARGET: STM32F100C4Tx.cpu - Not halted
in procedure ‘reset’
in procedure ‘ocd_bouncer’

Info : device id = 0x10016420
Info : flash size = 32kbytes
Error: timed out while waiting for target halted
TARGET: STM32F100C4Tx.cpu - Not halted
in procedure ‘reset’
in procedure ‘ocd_bouncer’

Error: timed out while waiting for target halted
TARGET: STM32F100C4Tx.cpu - Not halted
in procedure ‘reset’
in procedure ‘ocd_bouncer’

Error: Target not halted
Error: failed erasing sectors 0 to 3
Error: flash_erase returned -304
Info : dropped ‘gdb’ connection

------------------------------
What i do wrong?
How I can start debug from main function?


OpenSUSE 42.2 x64
System Workbench for STM32 - OpenOCD (for Linux 64bits) Version: 1.13.2.201703061529
STM32L-DISCOVERY with own connected board via SWD (no reset use)

Hi diprog

As they say, ” STM32F100C4Tx.cpu: hardware has 6 breakpoints, 4 watchpoints ” .
In my opinion you have too many breakpoints in your debbung system.
You need to remove them and it will works.

Best regards
Souleymane ( AC6-Training)


Hi

You have to connect a reset line or else use a non default openocd local script (i.e. reset_config srst_nogate) or else override the default in run/debug config with openocd option.

Dieter

Yes. You are right.
The problem is newer or latest script try to use HW_RST on ST-Link V2.


I use this device for program my STM32f407vgt6 controller, and I have same issure

-----------------------
‘’Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
Error: timed out while waiting for target halted
TARGET: stm32f4x.cpu - Not halted
in procedure ‘reset’
in procedure ‘ocd_bouncer’



Error: Target not halted
Error: failed erasing sectors 0 to 1
Error: flash_erase returned -304’’
-----------------------
for program controller i use stlink v2 mini (http://www.waveshare.com/st-link-v2-mini-stm32.htm)
By default, the microcontroller is not programed openstm32.
before modifying cfg fileQuestion

than i google some information and modifying some lines

modifying cfg fileQuestion

and result (program works good):
the resultQuestion

but debug do not work
debug errorQuestion

What can be the problem?

also st-link v2 works fine
st-link v2Question


UPDATE:

How to solve this issure:

-----------
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
adapter speed: 1800 kHz
Error: timed out while waiting for target halted
TARGET: stm32f4x.cpu - Not halted
in procedure ‘reset’
in procedure ‘ocd_bouncer’



Error: Target not halted
Error: failed erasing sectors 0 to 1
Error: flash_erase returned -304
-----------
see attached photo

text: -c “reset_config none separate”

Безымянный14154


Is there any problem with last version? I am facing this problem after updating to lates version. after downgrading the problem dissapears...

Regards,

Jon


 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs