Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error -3 opening ST-Link/V2 device

I'm trying to compile and upload an STM32F4 Discovery project through Eclipse under Linux Mint 16. The project compiles correctly, but during the upload I get the error:

WARN src/stlink-usb.c: Error -3 opening ST-Link/V2 device 003:007

I'm using stlink ( https://github.com/texane/stlink ) and the ST-LINK/V2 is listed on lsusb under bus 003, device 007.

Anyone else got the same error and found a solution?

like image 515
ascallonisi Avatar asked Apr 26 '14 14:04

ascallonisi


People also ask

How do I connect STM32 to St-Link V2?

Nucleo ST-LINK/V2 To use the built-in debugger, you must remove the jumpers from CN2 (Nucleo-64) or CN4 (Nucleo-144). Then you can use CN4 (Nucleo-64) or CN6 (Nucleo-144) to connect to your target board. This debugger has a 6-pin dupont header for connecting to a SWD header on the target board.

What is St-Link V2 programmer?

The ST-LINK/V2 is an in-circuit debugger and programmer for the STM8 and STM32 microcontrollers. The single-wire interface module (SWIM) and JTAG/serial wire debugging (SWD) interfaces are used to communicate with any STM8 or STM32 microcontroller located on an application board.


1 Answers

SOLVED: It was a permissions issue, solved by adding a rule

/etc/udev/rules.d/45-usb-stlink-v2.rules

(number and name can be whatever you want) and pasting inside it the following:

#FT232
ATTRS{idProduct}=="6014", ATTRS{idVendor}=="0403", MODE="666", GROUP="plugdev"

#FT2232
ATTRS{idProduct}=="6010", ATTRS{idVendor}=="0403", MODE="666", GROUP="plugdev"

#FT230X
ATTRS{idProduct}=="6015", ATTRS{idVendor}=="0403", MODE="666", GROUP="plugdev"

#STLINK V1
ATTRS{idProduct}=="3744", ATTRS{idVendor}=="0483", MODE="666", GROUP="plugdev"

#STLINK V2
ATTRS{idProduct}=="3748", ATTRS{idVendor}=="0483", MODE="666", GROUP="plugdev"

After that you can reboot or try

sudo service udev restart

and everything should be ok.

Sources:

http://embeddedprogrammer.blogspot.co.uk/2012/09/stm32f4discovery-development-with-gcc.html

http://www.wolinlabs.com/blog/linux.stm32.discovery.gcc.html

like image 106
ascallonisi Avatar answered Sep 29 '22 23:09

ascallonisi