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


stm32f4 with nucleo-f401RE

hi,

i’m working with the nucleo f401re (and other cards like nucleo l476rg or 32f476gdiscorvey).
for the nucleo f401 re, i cannot connect to the card with openocd.

I downloaded openocd to 0.9.0 and it worked fine in console mode.
(i can too attach the debugger to open ocd in eclipe)
i also pointed the executable in the plugin and i arrive start too in console mode (see below)

C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.externaltools.openocd.win32_1.12.0.201611241417\tools\openocd\bin>openocd -f “C:\_work\_webminar5\OpenOCD-20160901\share\openocd\scripts\interface\stlink-v2-1.cfg” -f “C:\_work\_webminar5\OpenOCD-20160901\share\openocd\scripts\target\stm32F4x.cfg” -s “C:\_work\_webminar5\OpenOCD-20160901\share\openocd\scripts”

i think that something doesn’t work in the eclipse configuration for this board to start openocd because i can debug for the other board above and openocd work fine.

(see below the log)


Open On-Chip Debugger 0.10.0-dev-00273-g394abef (2016-11-24-15:15)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_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 v27 API v2 M v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.251154
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting ‘gdb’ connection on tcp/3333
Info : device id = 0x10016433
Info : flash size = 512kbytes
undefined debug reason 7 - target needs reset
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’


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 0
Error: flash_erase returned -304

debugger:

Error in final launch sequence
Failed to execute MI command:
load C:\_work\_webminar5\401retest\Debug\401retest.elf

Error message from debugger back end:
Error erasing flash with vFlashErase packet
Error erasing flash with vFlashErase packet

I had quite a lot of similair messages working on a stm32f103C8 ‘bluepill’ board. This only had a 4-wire SWD connector (No reset). The only way I could get openocd to work was by editing the cfg scripts in D:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.11.1.201611241417\resources\openocd\scripts and comment out the line
‘reset_config srst_only srst_nogate connect_assert_srst’
in the file ‘target\stm32f4.cfg

I’m assuming your board level script is ‘nucleo_f401re.cfg’
This too would need the line ‘reset_config srst_only srst_nogate’ commented out and replaced by ‘reset_config none’

Hope this works for you as well.


you are the best ...

i learn with the command line how to start openod,and then open a debug console mode.
i do too a configuration to call externally in eclipse open ocd.

i lost 3 day but sometime, we must learn ;->>

Br,
Christophe



 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 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