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


GDB with no symbol table and OpenOCD fails libusb_open()

I’m using a Nucleo F446RE board and I’m using System Workbench 1.9.0 to debug in it.

I have CN4 jumpers ON (to enable on board MCU debug), PWR jumper on 2-3 (powered by SWD VBUS) and I connect to it using ST-Link Utility. I already upgraded ST-Link firmware and computer drivers.

I have a C++ project (mixed with C) that uses two static libraries and everything is built and linked with success. When I try to debug it (right click on the project -> Debug as -> Ac6 STM C/C++) I get this from GDB:

“No symbol table is loaded. Use the “file” command.
Function “main” not defined.”

I have -O0 and -g3 flags for every C/C++ compiler flags and -g for assembler as well.

Another problem is that OpenOCD can’t open USB device:

“adapter speed: 2000 kHz
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_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 SWIM v15 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 3.269266”

First of all, this is supposed to be using SWD and ST-Link v2-1, and it looks like it’s using V2 with JTAG (??). I’ve followed the .cfg files used for this project(nucleo_f446re.cfg)and everything looks fine.

Are these problems related?

>Another problem is that OpenOCD can’t open USB device:

Assuming you are using Linux: Permission problem?

To check you could start OOCD with root permissions, but then you should set an appropriate udev rule.

>Are these problems related?

Not in any way.

JimBob, I’m using Windows 8.1 (which I read everywhere that it’s basically a mess with LibUSB devices).

I think I’ve already solved my second problem, I didn’t have my startup folder (maybe I deleted it by accident). Right now I don’t have the missing function error but then again, OpenOCD can’t open the device.


is stlink utility able to connect ? if yes disconect or close
is it some usb 3.0 port ? if yes try to plug on different port preferably usb 2.0 ,


It’s a USB 3.0 port, but now it works fine. It still gives the same LIBUSB_ERORR but the OpenOCD provided by AC6 works great.

I first tried to change drivers using a tool but it didn’t worked (at least the application was constantly giving an error).


 

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