7

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?

ascallonisi
  • 871
  • 1
  • 11
  • 20

1 Answers1

6

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

ascallonisi
  • 871
  • 1
  • 11
  • 20
  • Cross verify the idProduct and idVendor by checking the dmesg prints. When using NUCLEO boards the idProduct is different and its 374b. – 0xAB1E Mar 05 '15 at 05:07