Arduino IDE + STM32 = "Failed to open serial device" (Linux)

All distros
Ltihimlin
Posts: 5
Joined: Thu Oct 05, 2017 1:49 pm

Arduino IDE + STM32 = "Failed to open serial device" (Linux)

Post by Ltihimlin » Thu Oct 05, 2017 2:06 pm

AS the title suggests, I'm currently trying to setup an STM32 (similar to the Blue Pill).
I followed the instructions on the website and got it up and running. The problem is, when I try to upload code, I get the following message(s):

Code: Select all

Failed to open serial device.
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!

dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

Waiting for /dev/ttyACM0 serial...Done
dfu-util: No DFU capable USB device available
The first line is what's bugging me. I already set the IDE up on my laptop with no such issue.
Could I've missed a permission problem? I'd appreciate some quick help.

Thanks in advance.

zmemw16
Posts: 1482
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Arduino IDE + STM32 = "Failed to open serial device"

Post by zmemw16 » Thu Oct 05, 2017 2:27 pm

ok on laptop, not ok on different system

you say 'similar' ? what colour is pcb ? put up the link to the item, i'm assuming aliexpress, ebay or elsewhere !
The command "sudo lsof | grep ttyACM" will show if modem manager is holding onto the ttyACM port.
what haven't you done that you did for the laptop?
restart service udev ?
without repeating the actual actions, on the laptop,go through the install line by line, but do the install to the desktop(??)

udev files?
user and group?
blacklist
which linux?
what does lsusb show?
what does lsusb show on the laptop?
not moved the boot link ? i always use st-link, usb stick for the pill type boards or blue/white egg shaped st-link to the jtag socket. never really had an issue.

stephen

Ltihimlin
Posts: 5
Joined: Thu Oct 05, 2017 1:49 pm

Re: Arduino IDE + STM32 = "Failed to open serial device"

Post by Ltihimlin » Thu Oct 05, 2017 2:42 pm

what colour is pcb ?
Blue.
put up the link to the item, i'm assuming aliexpress, ebay or elsewhere !
This seems to be it, I'm not sure though since I didn't buy them myself.
what haven't you done that you did for the laptop?
I did almost everything the same way except for the permissions which I had to have someone else set because I myself am a user in the network where I try to get this set up and do not have permissions to tinker with them myself. I sent them the following rules which they implemented:

Code: Select all

ATTRS{idProduct}=="1001", ATTRS{idVendor}=="0110", MODE="664", GROUP="plugdev"
ATTRS{idProduct}=="1002", ATTRS{idVendor}=="0110", MODE="664", GROUP="plugdev"
ATTRS{idProduct}=="0003", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple", ENV{ID_MM_DEVICE_IGNORE}="1"
ATTRS{idProduct}=="0004", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple", ENV{ID_MM_DEVICE_IGNORE}="1"
which linux?
Linux Mint 17.2 Cinnamon 64-Bit

"lsusb" gives me:

Code: Select all

Bus 002 Device 006: ID 046a:0011 Cherry GmbH G83 (RS 6000) Keyboard
Bus 002 Device 005: ID 046d:c03e Logitech, Inc. Premium Optical Wheel Mouse (M-BT58)
Bus 002 Device 004: ID 9710:7830 MosChip Semiconductor MCS7830 10/100 Mbps Ethernet adapter
Bus 002 Device 003: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 08e6:3437 Gemalto (was Gemplus) GemPC Twin SmartCard Reader
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 028: ID 1eaf:0004
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
"dmesg | tail" shows the following:

Code: Select all

[ 1527.908081] usb 3-5: Product: Maple 003
[ 1527.908084] usb 3-5: Manufacturer: LeafLabs
[ 1527.908087] usb 3-5: SerialNumber: LLM 003
[ 1528.820094] usb 3-5: USB disconnect, device number 27
[ 1529.252050] usb 3-5: new full-speed USB device number 28 using ohci-pci
[ 1529.474076] usb 3-5: New USB device found, idVendor=1eaf, idProduct=0004
[ 1529.474082] usb 3-5: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1529.474085] usb 3-5: Product: Maple
[ 1529.474089] usb 3-5: Manufacturer: LeafLabs
[ 1529.477149] cdc_acm 3-5:1.0: ttyACM0: USB ACM device
"ls -l /dev/ttyACM0" results in:

Code: Select all

crw-rw-r-- 1 root dialout 166, 0 Oct  5 15:29 /dev/ttyACM0

Ltihimlin
Posts: 5
Joined: Thu Oct 05, 2017 1:49 pm

Re: Arduino IDE + STM32 = "Failed to open serial device"

Post by Ltihimlin » Thu Oct 05, 2017 2:58 pm

I looked around some more and figured out, that I'm not a member of the dialout group. could this be the problem?

zmemw16
Posts: 1482
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Arduino IDE + STM32 = "Failed to open serial device"

Post by zmemw16 » Thu Oct 05, 2017 3:51 pm

are you in it on the laptop ? i suspect probably yes.
did you get asked for an admin password when you did that install ?
now you're off to see your admin
srp

User avatar
RogerClark
Posts: 7413
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Arduino IDE + STM32 = "Failed to open serial device"

Post by RogerClark » Thu Oct 05, 2017 8:59 pm

Ltihimlin wrote:
Thu Oct 05, 2017 2:58 pm
I looked around some more and figured out, that I'm not a member of the dialout group. could this be the problem?
yes. you need to be in that group

Ltihimlin
Posts: 5
Joined: Thu Oct 05, 2017 1:49 pm

Re: Arduino IDE + STM32 = "Failed to open serial device"

Post by Ltihimlin » Fri Oct 06, 2017 8:33 am

I am in it on my laptop.
I contacted the system admins and asked them to add me to it. No response yet. Will keep you guys updated on whether I need more help or it's solved.


zmemw16
Posts: 1482
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: Arduino IDE + STM32 = "Failed to open serial device"

Post by zmemw16 » Sat Oct 07, 2017 12:14 am

he doesn't have 'root' on the machine he's installing on. more correctly insufficient privileges.
hence the visit to his admin person
srp

eggsylah
Posts: 3
Joined: Fri Oct 06, 2017 9:26 pm

Re: Arduino IDE + STM32 = "Failed to open serial device"

Post by eggsylah » Mon Oct 09, 2017 3:22 am

I think the udev rules provided in the core are not ideal -- certainly not on a systemd based Linux system.
On my Fedora and Arch systems I didn't have a plugdev group and didn't have full success when I added one.
Essentially, I still needed to use sudo for the dfu-util command.

The solution I have been using was to use +uaccess and this works without problems for me.

So my 45-maple.rules in /etc/udev/rules.d looks like this:
SUBSYSTEM=="usb" ATTRS{idProduct}=="0003", ATTRS{idVendor}=="1eaf", TAG+="uaccess"
SUBSYSTEM=="usb" ATTRS{idProduct}=="0004", ATTRS{idVendor}=="1eaf", TAG+="uaccess"

I think this is a preferred approach for modern Linux systems and is probably easier that getting a sysadmin to add new groups.
From reading, it should work on Ubuntu but I can't test that.However, I can recommend it for Arch and Fedora 24, 25 and 26.

Eric

Post Reply