Loading...
 
Skip to main content

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).