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


openocd - wrong paths on win x64

Hi,

I was not able to download/debug generated code into a STM32F3 Discovery board (STM32F303). It was not possible to connect to the target.

Testing openocd alone I have observed that openocd directory is set to “/usr/bin” (below is opeocd output):

Debug: 17 32 options.c:98 add_default_dirs(): bindir=/usr/bin
Debug: 18 32 options.c:99 add_default_dirs(): pkgdatadir=/usr/share/openocd

this could be not so big problem (my guess) but the path where “script” folder is located on a win 64 system is not correct:
Debug: 22 47 configuration.c:44 add_script_search_dir(): adding C:/Ac6/SystemWorkbench/plugins/fr.ac6.mcu.externaltools.openocd.win32_1.2.0.201505291716/tools/openocd/bin/usr/share/openocd/scripts

On my sistem openocd ‘scripts’ folder is located on this path:
C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.2.0.201506021103\resources\openocd\scripts\board
so the above path will not working.

I have check this on both Win 7 x64 and Win 8.1 x64 machine. Installer used was “install_sw4stm32_win_64bits-v1.2.exe”, and last updates after install.

Using another Windows buil for opencod (Freddie Chopin) I was able to connect to the board (see logs attached).

Attached is the command line scripts used and log files.

Plese let me know if you can reproduce this behavior.
Did you build yourself openocd ?


=========
Here are parts of the opeocd output (Freddie Chopin build) - just for reference:

Commnad line window:
------------
C:\openocd-0.9.0_fc\bin\openocd.exe -f c:\openocd-0.9.0_fc\scripts\board\stm32f3discovery.cfg -d3 -l d:\openocd_log_fc.txt

Open On-Chip Debugger 0.9.0 (2015-05-19-12:06)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.htmlQuestion
User : 13 0 command.c:546 command_print(): debug_level: 3
Debug: 14 16 command.c:145 script_debug(): command - ocd_command ocd_command type ocd_log_output d:openocd_log_fc.txt
Debug: 15 16 command.c:145 script_debug(): command - log_output ocd_log_output d:openocd_log_fc.txt

Parts of the log file:
-----------
Debug: 17 32 options.c:98 add_default_dirs(): bindir=bin
Debug: 18 32 options.c:99 add_default_dirs(): pkgdatadir=
Debug: 19 32 options.c:100 add_default_dirs(): run_prefix=C:/openocd-0.9.0_fc/
Debug: 20 32 configuration.c:44 add_script_search_dir(): adding C:\Users\ciprian\AppData\Roaming/OpenOCD
Debug: 21 32 configuration.c:44 add_script_search_dir(): adding C:/openocd-0.9.0_fc//site
Debug: 22 32 configuration.c:44 add_script_search_dir(): adding C:/openocd-0.9.0_fc//scripts
Debug: 23 32 configuration.c:84 find_file(): found c:\openocd-0.9.0_fc\scripts\board\stm32f3discovery.cfg
Debug: 24 32 configuration.c:84 find_file(): found C:/openocd-0.9.0_fc//scripts/interface/stlink-v2.cfg
.........
Debug: 257 47 stlink_usb.c:1602 stlink_usb_open(): stlink_usb_open
Debug: 258 47 stlink_usb.c:1619 stlink_usb_open(): transport: 1 vid: 0x0483 pid: 0x3748 serial:
Info : 259 120 stlink_usb.c:523 stlink_usb_version(): STLINK v2 JTAG v23 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : 260 120 stlink_usb.c:1730 stlink_usb_open(): using stlink api v2
Debug: 261 120 stlink_usb.c:722 stlink_usb_init_mode(): MODE: 0x02
Info : 262 120 stlink_usb.c:555 stlink_usb_check_voltage(): Target voltage: 2.907062

Above is a sucesfull connection to the board (see voltage target and STLINK version of the target board)

My mistake. Following the exact steps described on User Guide - “Importing an STM32CubeMX generated project under System Workbench for STM32” it was possible to compile and debug the project (STM32F3 Discovery board).

I use a Win 8.1 64 bit machine

It turns out that the System Workbench set few paths (correct paths) when it is invoked by pressing the Debug icon on the Eclipse:

Open On-Chip Debugger 0.9.0-dev-00415-g2d4ae3f-dirty (2015-04-22-11:10)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
User : 13 15 command.c:546 command_print(): debug_level: 3
Debug: 14 15 configuration.c:44 add_script_search_dir(): adding C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.2.0.201506021103\resources\openocd\scripts\st_board
Debug: 15 15 configuration.c:44 add_script_search_dir(): adding C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.2.0.201506021103\resources\openocd\scripts

and then configuration files could be found

Debug: 22 15 configuration.c:84 find_file(): found stm32f3discovery.cfg
Debug: 23 15 configuration.c:84 find_file(): found C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.2.0.201506021103\resources\openocd\scripts/interface/stlink-v2.cfg


To activate debug output for openocd I have added “-d3” under “OpenOCD Command:” entry in “Debug Configuration” window under “Debugger” tab, the comand looks like:
”${openstm32_openocd_path}\openocd.exe” -d3
The output is printed in Console window when debug is started

Attached is the complet file log.


 

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