Uploading Sketch to Maple mini from Arduino 1.6.9 [SOLVED]

navintiwari08
Sun Jul 31, 2016 3:16 pm
Hello there!
I’ve one of those maple mini clones. I put this new boot loader “maple_mini_boot20.bin” using FTDI 232 interface. I then connected the maple via usb and tried uploading sketch from Arduino 1.6.9 IDE. It failed and gave errors as below..
Sketch uses 12,284 bytes (9%) of program storage space. Maximum is 122,880 bytes.
Global variables use 2,560 bytes of dynamic memory.
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 [email protected]

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
dfu-util: No DFU capable USB device available


simonf
Sun Jul 31, 2016 3:26 pm
Is it a baite maple mini?
Which bootloader did you select in the IDE? Origonal or Maple Mini.
Did you select the com port in the IDE?
What device is showing in device manager?

navintiwari08
Mon Aug 01, 2016 5:50 am
Is it a baite maple mini?
Yes, its the baite maple mini clone. Bought it on aliexpress.com.

Which bootloader did you select in the IDE? Origonal or Maple Mini.
I selected bootloader 2.0 (20 kb RAM and 128 K flash). I selected the board as “maple mini”

Did you select the com port in the IDE?
Yes, the com port is selected as ttyACM0 (I’m using Ubuntu 14.04)

What device is showing in device manager?
I’m not using Windows. I’m using Ubuntu 14.04.

I’m able to upload the sketch only when the board is in perpetual boot loader mode.


simonf
Mon Aug 01, 2016 1:35 pm
OK so you upgraded the bootloader so it no longer has the original bootloader.

My Ubuntu box is headless so i may struggle to help you, but I will give it a try. I will see if I have a spare maple I can change the bootloader in.

As you are in linux to find out about the device unplug and replug your device. The run

dmesg | grep -i USB

[228778.139821] usb 8-2: new full-speed USB device number 4 using uhci_hcd
[228778.309749] usb 8-2: New USB device found, idVendor=1eaf, idProduct=0004
[228778.309755] usb 8-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[228778.309758] usb 8-2: Product: Maple
[228778.309761] usb 8-2: Manufacturer: LeafLabs
[228778.425088] cdc_acm 8-2:1.0: ttyACM0: USB ACM device
[228778.427825] usbcore: registered new interface driver cdc_acm
[228778.427828] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters


fredbox
Mon Aug 01, 2016 2:40 pm
Bootloader 2.0 on Linux Mint 17.3
[570092.988859] usb 1-1: new full-speed USB device number 81 using xhci_hcd
[570093.118193] usb 1-1: New USB device found, idVendor=1eaf, idProduct=0004
[570093.118208] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[570093.118211] usb 1-1: Product: Maple
[570093.118214] usb 1-1: Manufacturer: LeafLabs
[570093.118421] usb 1-1: ep 0x82 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[570093.118974] cdc_acm 1-1:1.0: ttyACM0: USB ACM device

navintiwari08
Mon Aug 01, 2016 4:46 pm
Here is what i got after dmesg | grep -i USB
[ 661.320040] usb 2-1: new full-speed USB device number 6 using ohci-pci
[ 661.532296] usb 2-1: New USB device found, idVendor=1eaf, idProduct=0004
[ 661.532304] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 661.532308] usb 2-1: Product: Maple
[ 661.532312] usb 2-1: Manufacturer: LeafLabs
[ 661.534408] cdc_acm 2-1:1.0: ttyACM0: USB ACM device

zmemw16
Mon Aug 01, 2016 6:21 pm
try this; i have it in shell script called comms

ls -lt /dev |egrep 'stlink|ttyACM|ttyUSB'


navintiwari08
Tue Aug 02, 2016 4:39 am
I’ll post the result of ls -lt /dev |egrep 'stlink|ttyACM|ttyUSB'

zmemw16
Tue Aug 02, 2016 9:19 am
that button pressing does get annoying, worse with fat fingers :)

permissions, if wrong cause the process to stop. that’s fine, but if incorrect mister blaster can kill anything.

crwxrwxrwx 1 stephen dialout 166, 0 Aug 2 09:04 ttyACM0
lrwxrwxrwx 1 root root 7 Aug 2 09:04 maple -> ttyACM0
lrwxrwxrwx 1 root root 15 Aug 2 09:04 stlinkv2_7 -> bus/usb/001/008


navintiwari08
Wed Aug 03, 2016 5:47 pm
Hey..
I did this:
ls -lt /dev |egrep 'stlink|ttyACM|ttyUSB'

fredbox
Wed Aug 03, 2016 8:16 pm
Enter groups to see if you are a member of the dialout group.
$ groups
fred adm tty dialout cdrom sudo dip plugdev lpadmin sambashare

zmemw16
Thu Aug 04, 2016 12:25 am
i’ve edited the relevant udev rules file /etc/udev/rules.d/25-ARDUINO.rules in my case to set stephen as OWNER and
set it as wide open with 777.
i suspect i got tee’d with it not working, so as it’s my laptop and i’m the sole user. … …
i know it’s not the proper way, but i’m an old mech eng with a spanner/hammer as reqd. :)

stephen


navintiwari08
Sun Aug 07, 2016 12:52 pm
yes, I’m the member of the group ‘dialout’
navin adm dialout cdrom sudo dip plugdev lpadmin sambashare

zmemw16
Sun Aug 07, 2016 3:14 pm
navintiwari08 wrote:yes, I’m the member of the group ‘dialout’
navin adm dialout cdrom sudo dip plugdev lpadmin sambashare

navintiwari08
Mon Aug 08, 2016 6:42 am
ok.. thanks for the info! I’m sure that will come handy.
But I still haven’t gotten anywhere with my original question.
Do I have to put the board in perpetual boot loader mode before uploading a sketch?

zmemw16
Mon Aug 08, 2016 12:07 pm
i seem to have to, using stlink download, serial never seems to work.
even after it’s written to flash, i/o is problematic.

barest whiff of blue smoke, so bare i wasn’t even sure i’d seen it.
one sd module and the 16GB card inserted. 2 different makes of module, one pinning gnd, 3v3,5v; t’other 5v gnd

not good :!: :( :(

stephen

ps. add a hub to the list


mrburnette
Mon Aug 08, 2016 1:19 pm
Hi Mr. Burnette,

I’ve a maple mini clone from baite. I bought it on aliexpress.com.
I burnt the new bootloader 2.0 named “maple_mini_boot20.bin” via FTDI 232 USB to Serial.
When I tried to upload sketch from Arduino IDE, it gave errors about not able to find any DFU device.
Then I put the maple in perpetual boot loader mode and hit “upload” again in the IDE. This time it uploaded the code and runs flawlessly.

My question is, do I have to put the maple mini in perpetual boot loader mode every time I want to upload the code? Can’t it be done with just hitting the upload button in IDE and not touching any buttons on maple mini? I’m using Arduino 1.6.9 on Ubuntu 14.04.

Specific to the Maple Mini (Baite) model: in my experience, 9 out of 10 times the COMx port will toggle the reset and put the Mini into DFU mode automatically. The other 10% it will not. My experience is with Win8.1 and Linux Mint 17.3 Other versions of OS’s may give completely different results, but I know of no one that has achieved 100% upload via the IDE without having to occasionally resort to the forced DFU mode.

Remember, for Windows, there is the requirement to install the serial drivers… see the WiKi.

There are a large number of posts on the forum about this issue which is why I did not respond to your PM, things need to be posted to be searchable.
Out site is fully Google indexed, so next time try a site specific Google query like:
https://www.google.com/#q=serial+upload … 2duino.com

Ray


fredbox
Mon Aug 08, 2016 2:15 pm
9 out of 10 times the COMx port will toggle the reset and put the Mini into DFU mode automatically
That matches my experience. I always put a Serial.begin statement in the setup section, even if I don’t need it.

If uploading fails, I try again, pressing the reset and compile buttons at the same time. That usually lets it upload.

If your program uploads then crashes / locks up, then you may have to use the perpetual mode to recover.

I am using Mint 17.3, IDE 1.6.5, bootloader 2.0.


navintiwari08
Tue Aug 09, 2016 1:57 pm
Thanks Mr. Bunette for the info.
Its not uploading even once without PBM on Ubuntu 14.04.
I guess I’ll have to use it this way only.

-Navin


devan
Wed Aug 10, 2016 4:03 am
One possibility is that the modem manager thinks that the Maple serial port (which technically advertises itself as a stripped down modem) is a real modem and it’s trying to use it as such, preventing you from accessing it to reset it.

You can add a udev rule to prevent that:
ATTRS{idVendor}=="1eaf" ATTRS{idProduct}=="0004", ENV{ID_MM_DEVICE_IGNORE}="1"


navintiwari08
Fri Aug 12, 2016 11:09 am
ATTRS{idVendor}=="1eaf" ATTRS{idProduct}=="0004", ENV{ID_MM_DEVICE_IGNORE}="1"

devan
Fri Aug 12, 2016 3:36 pm
Oh, in that case, I’ve encountered that exact symptom before.

Try tweaking the delay in the maple_upload script in the Arduino_STM32 directory under tools/linux or tools/linux64. On my laptop, a 1000ms delay works consistently, whereas the default of 750ms never worked.


navintiwari08
Sat Aug 13, 2016 10:27 am
Thanks a lot, Devan!!

1500 ms works fine with my desktop pc. I can now upload the sketch with ease. Case closed!

-Navin


Leave a Reply

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