I\'m using Launchpad\'s gcc-arm-none-eabi 4.9-2015q2 to compile for an STM32F0, and now I\'d like to debug using arm-none-eabi-gdb from that collection. My ST-Link v2 is part of
In my case I also got Error: open failed
but all the configuration was OK. Then I did dmesg | grep usb
to see why it cannot connect via USB (on Ubuntu). The dmesg told me that there are power issues and perhaps the cable is faulty. As I had used the same cable earlier the same day and some LEDs still flashed on the board, I first ignored the message. But then I finally decided to try, bought another cable and lo and behold! It was a faulty cable - with the new one everything works. So, not always a software problem after all.
Though if you do lsusb
(or use device manager in Windows) and the board is nicely listed, it will probably not be a cable issue. If it is missing, it might be.
I found a fix. The VID/PID pair in stlink-v2.cfg was wrong. They had this:
hla_vid_pid 0x0483 0x3748
but it should be this:
hla_vid_pid 0x0483 0x374B
letter "B", not the digit "8".
1.in eclipse ide-->project-->inc --> {project_name} debug.cfg ->source [find interface/stlink.cfg]
check your interface debugger whether stlink.cfg or stlink-v2.cfg or stlink-v2-1.cfg and change [find interface/stlink.cfg]
{or}TRY
2.C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_2.5.0.201904120827\resources\openocd\st_scripts\interface\stlink.cfg(or stlink-v2.cfg or stlink-v2-1.cfg)
add hla_vid_pid 0
Nucleo F411RE embedded a stlink v2-1 not stlink v2
so change the script file like this:
source [find interface/stlink-v2-1.cfg]
transport select hla_swd
source [find target/stm32f4x.cfg]
reset_config srst_only
The file stlink-v2.cfg
might be ok. You probably should use stlink-v2-1.cfg
file (inside that file is hla_vid_pid 0x0483 0x3748
).