Cannot handle device "/dev/ttyUSB0"

wizard
Wed May 06, 2015 6:49 am
I’ve got this chinese clone from ebay, it’s STM32F103C series, which is what is selected in the Board menu of Arduino IDE 1.6.3

I followed the instructions on https://github.com/rogerclarkmelbourne/ … stallation

Then in “Perpetual bootloader” mode, i compiled MrBrunette’s Blink example and i get this error:

Build options changed, rebuilding all

Sketch uses 13,616 bytes (10%) of program storage space. Maximum is 128,000 bytes.
Global variables use 3,888 bytes of dynamic memory.
stm32flash 0.4

http://stm32flash.googlecode.com/

Using Parser : Raw BINARY

Error probing interface "serial_posix"
Cannot handle device "/dev/ttyUSB0"
Failed to open port: /dev/ttyUSB0


RogerClark
Wed May 06, 2015 11:16 am
Try getting the latest version, we’ve updated the linux support and it works for everyone that has tried it

Re: Permissions

Try setting the permissions to 777 that worked for me


wizard
Thu May 07, 2015 4:10 pm
I get the same error.

I was tailing the syslog with:

sudo tail -f /var/log/syslog


madias
Thu May 07, 2015 4:30 pm
does the board led blink constantly when you bring it into p.bootloader mode?

wizard
Thu May 07, 2015 4:34 pm
Yes it does. And there is no more a /dev/ttyUSB0 or /dev/ttyACM0.

user@computer:~$ stm32flash /dev/ttyACM0
stm32flash 0.4

http://stm32flash.googlecode.com/

Error probing interface "serial_posix"
Cannot handle device "/dev/ttyACM0"
Failed to open port: /dev/ttyACM0


madias
Thu May 07, 2015 6:26 pm
Did you read this complete forum thread?
viewtopic.php?f=27&t=61&start=10

(Maybe we should move this thread to “maple mini” or “linux”?)


wizard
Thu May 07, 2015 10:15 pm
All the permission settings are correct, according to that thread.


Noticed that whenever i put the device on PB mode, it disconnects, thus the IDE (or stm32flash) cannot find it.

Is this normal behaviour or the board is possibly bricked?


RogerClark
Thu May 07, 2015 11:58 pm
OK.

If the board blinks constantly from the start it sounds like it doesn’t have blink installed

Put the board into perpetual bootloader mode

press reset then hold down the other button for a few secs

The led should continue to blink

You should have a USB device called “Maple DFU” VID 1EAF/0003

Have you compiled and installed DFU Util, See the linux installation pages in the wiki

Once you have DFU Util installed you should be able to upload

Note you will probable need to set the permissions on the DFU device, I forget exactly what it is , something like /dev/bus/xxx etc


RogerClark
Thu May 07, 2015 11:59 pm
PS.

Do you have a Uno, its possible to reflash the bootloder with the new one using a Uno has a programmer if you really have problems


wizard
Fri May 08, 2015 7:15 am
Thank you Roger.

I’ve compiled dfu-utils 0.8 but not sure if it’s installed correctly. How to check it?


RogerClark
Fri May 08, 2015 7:29 am
The script looks like this

#!/bin/bash
set -e
if [ $# -lt 4 ]; then
echo "Usage: $0 $# <dummy_port> <altID> <usbID> <binfile>" >&2
exit 1
fi
dummy_port=$1; altID=$2; usbID=$3; binfile=$4
DFU_UTIL=/usr/bin/dfu-util
if [ ! -x ${DFU_UTIL} ]; then
echo "$0: error: cannot find ${DFU_UTIL}" >&2
exit 2
fi


wizard
Fri May 08, 2015 10:17 am
Turns out, dfu-util is not system wide. It only runs in ~/dfu-util-0.8/src/

RogerClark
Fri May 08, 2015 10:29 am
i’d imagine you need to copy it to /usr/bin

e.g.

cp ~/dfu-util-0.8/src/dfu-util /usr/bin

you may need to use

sudo


wizard
Fri May 08, 2015 10:47 am
Okay. Now in PB mode

user@computter:~$ dfu-util -l

Found DFU: [1eaf:0003] ver=0201, devnum=12, cfg=1, intf=0, alt=1, name="DFU Program FLASH 0x08005000", serial="LLM 003"
Found DFU: [1eaf:0003] ver=0201, devnum=12, cfg=1, intf=0, alt=0, name="DFU Program RAM 0x20000C00", serial="LLM 003"


wizard
Fri May 08, 2015 10:51 am
RogerClark wrote:
Note you will probable need to set the permissions on the DFU device, I forget exactly what it is , something like /dev/bus/xxx etc

RogerClark
Fri May 08, 2015 11:14 am
Sorry

Linux is not my area of expertise. Try PM’ing @ahull or @RickKimball they are both Linux experts, one of them may be able to help you

See also

https://github.com/rogerclarkmelbourne/ … wiki/Linux

written by @ahull


wizard
Fri May 08, 2015 11:41 am
Thank you Roger.

I can confirm, i have dfu-util correctly installed.

The problem is “kind of” solved now: Installed Maple IDE v0.0.12 :)


wizard
Sat May 09, 2015 5:59 pm
I noticed the board option “Generic STM32F103C” does not use dfu, so i choose “LeafLabs Maple Mini Rev 2 to Flash”. Then it prompts another error:

<command-line>:0:1: error: macro names must be identifiers
Error compiling.


RogerClark
Sat May 09, 2015 8:52 pm
What board do you have?

The reason the Generic STM32F103C Series board doesn’t upload via DFU, is because generic boards don’t have that ability. Only boards with the additional USB reset hardware can use the Maple Bootloader which handles DFU upload

I will however check whether I get the same error when using the Maple Mini option


wizard
Sat May 09, 2015 9:39 pm
It’s this one

Thing is, i can upload a simple blink sketch via Maple IDE.


RogerClark
Sat May 09, 2015 10:00 pm
Ok

That board is a maple mini

You need to use the maple mini board type

I will need to check on my Linux machine if I can replicate the same issue


Leave a Reply

Your email address will not be published. Required fields are marked *