STM32duino bootloader Linux confusion.

Bootloader for boards that don't have the addition hardware found on the Maple mini, which resets the USB
MasterT
Posts: 11
Joined: Wed Mar 08, 2017 4:17 am

STM32duino bootloader Linux confusion.

Postby MasterT » Sat Mar 11, 2017 9:40 am

HI,
I installed STM32duino bootloader following instructions on this web site https://medium.com/@paramaggarwal/programming-an-stm32f103-board-using-usb-port-blue-pill-953cec0dbc86#.tppplljtw

But uploading doesn't work, my own research turns blank, so here is my questions, sorry if it was asked many times:
1. Error:
An error occurred while uploading the sketch
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
dfu-util: Cannot open DFU device 1eaf:0003
dfu-util: No DFU capable USB device available


2. My troubleshooting:
[69238.681209] usb 1-2.3: new full-speed USB device number 63 using xhci_hcd
[69238.758601] usb 1-2.3: New USB device found, idVendor=1eaf, idProduct=0004
[69238.758616] usb 1-2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[69238.758625] usb 1-2.3: Product: Maple
[69238.758633] usb 1-2.3: Manufacturer: LeafLabs
[69238.761362] cdc_acm 1-2.3:1.0: ttyACM0: USB ACM device
XXXXXXX arduino-1.8.1]$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0bda:57b8 Realtek Semiconductor Corp.
Bus 001 Device 003: ID 04f3:0389 Elan Microelectronics Corp.
Bus 001 Device 063: ID 1eaf:0004


It looks like DFU is trying to open 0003 but lsusb shows 0004, how this can be fixed?

And another question, could be related to an error, command line
/arduino-1.8.1/hardware/Arduino_STM32/tools/linux/maple_upload ttyACM0 2 1EAF:0003 /tmp/arduino_build_194473/Blink.ino.bin

says "linux", same time my PC running linux64, is it o'k?

User avatar
martinayotte
Posts: 1145
Joined: Mon Apr 27, 2015 1:45 pm

Re: STM32duino bootloader Linux confusion.

Postby martinayotte » Sat Mar 11, 2017 4:29 pm

MasterT wrote:It looks like DFU is trying to open 0003 but lsusb shows 0004, how this can be fixed?


In boards.txt ...

MasterT
Posts: 11
Joined: Wed Mar 08, 2017 4:17 am

Re: STM32duino bootloader Linux confusion.

Postby MasterT » Sat Mar 11, 2017 4:38 pm

Well, my board.txt is empty..
[NoName@localhost tools]$ pwd
/home/NoName/Softvari/arduino-1.8.1/hardware/Arduino_STM32/tools
[NoName@localhost tools]$ ls -l
total 16
-rw-rw-r--. 1 NoName NoName 0 Feb 25 21:26 boards.txt
drwxrwxr-x. 6 NoName NoName 4096 Feb 25 21:26 linux
drwxrwxr-x. 6 NoName NoName 4096 Mar 11 04:04 linux64
drwxrwxr-x. 6 NoName NoName 4096 Feb 25 21:26 macosx
drwxrwxr-x. 7 NoName NoName 4096 Feb 25 21:26 win

User avatar
martinayotte
Posts: 1145
Joined: Mon Apr 27, 2015 1:45 pm

Re: STM32duino bootloader Linux confusion.

Postby martinayotte » Sat Mar 11, 2017 4:41 pm

No, the one in Arduino_STM32/STM32F1/boards.txt .

MasterT
Posts: 11
Joined: Wed Mar 08, 2017 4:17 am

Re: STM32duino bootloader Linux confusion.

Postby MasterT » Sat Mar 11, 2017 5:00 pm

O'K, I changed to 0004, and now I see correct command line address
/hardware/Arduino_STM32/tools/linux/maple_upload ttyACM0 2 1EAF:0004 /tmp/arduino_build_982847/Blink.ino.bin
dfu-util 0.8

dfu-util: Invalid DFU suffix signature
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

An error occurred while uploading the sketch
dfu-util: Cannot open DFU device 1eaf:0003
dfu-util: No DFU capable USB device available
But why error messag e still saying "Cannot open DFU device 1eaf:0003" and doesn't uploading?

User avatar
martinayotte
Posts: 1145
Joined: Mon Apr 27, 2015 1:45 pm

Re: STM32duino bootloader Linux confusion.

Postby martinayotte » Sat Mar 11, 2017 6:57 pm

Good question ...
Maybe to debug further you can edit the script /hardware/Arduino_STM32/tools/linux/maple_upload, and just before the last line adding an echo would help :

Code: Select all

echo "${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R
"${DFU_UTIL}" -d ${usbID} -a ${altID} -D ${binfile} ${dfuse_addr} -R


Then, you could try copy/paste this echo as a new command.

MasterT
Posts: 11
Joined: Wed Mar 08, 2017 4:17 am

Re: STM32duino bootloader Linux confusion.

Postby MasterT » Sat Mar 11, 2017 8:06 pm

I insert a line, as advised:
Sketch uses 16056 bytes (24%) of program storage space. Maximum is 65536 bytes.
Global variables use 2816 bytes of dynamic memory.
/home/NoName/Softvari/arduino-1.8.1/hardware/Arduino_STM32/tools/linux/maple_upload ttyACM0 2 1EAF:0004 /tmp/arduino_build_299861/Blink.ino.bin
/home/NoName/Softvari/arduino-1.8.1/hardware/Arduino_STM32/tools/linux/dfu-util/dfu-util -d 1EAF:0004 -a 2 -D /tmp/arduino_build_299861/Blink.ino.bin -R
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

dfu-util: An error occurred while uploading the sketch
Cannot open DFU device 1eaf:0003
dfu-util: No DFU capable USB device available
No luck. :(

MasterT
Posts: 11
Joined: Wed Mar 08, 2017 4:17 am

Re: STM32duino bootloader Linux confusion.

Postby MasterT » Sat Mar 11, 2017 8:18 pm

And more confusion, port ttyACM0 belongs to dialout group, this what i used to in all arduino releases, nevertheless rules file 45-maple.rules says
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+="ttyUSB%n"
ATTRS{idProduct}=="0004", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="plugdev" SYMLINK+="maple"
I modify a symlink from maple to ttyUSB%n yesterday, probably should do the same for device 0004 now, but in device list it has name ttyACM0, where it cames from? And group, should it be dialout?

MasterT
Posts: 11
Joined: Wed Mar 08, 2017 4:17 am

Re: STM32duino bootloader Linux confusion.

Postby MasterT » Sat Mar 11, 2017 8:28 pm

Yes, I got it! Group name is wrong, here is how rules file 45-maple.rules should be:
ATTRS{idProduct}=="1001", ATTRS{idVendor}=="0110", MODE="664", GROUP="dialout"
ATTRS{idProduct}=="1002", ATTRS{idVendor}=="0110", MODE="664", GROUP="dialout"
ATTRS{idProduct}=="0003", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="dialout" SYMLINK+="ttyUSB%n"
ATTRS{idProduct}=="0004", ATTRS{idVendor}=="1eaf", MODE="664", GROUP="dialout" SYMLINK+="ttyUSB%n"

Thank you for your help. :)


Return to “Generic bootloader”

Who is online

Users browsing this forum: No registered users and 2 guests