I’m sorry I don’t really know which topic is this post related to in the forum, as I tried different things, so I’ll try to be clear with a new topic.
I recently recieved 5 maple minis clones from aliexpress, and I’m currently trying to make one of them behave the way I’d like (the other ones are jealously kept apart from my experiment’s fire). First, I ran a JTag/SWD programmer from school with a Keil µvision 5 program on one of them, everything went fine, so I know this programming method works, but at home, I don’t have any hardware for this.
So, my goal was to program the maple mini with a classic usb wire, and to put on it some arduino project or, best, some Keil µvision programs built with STM32Cube (and its HAL_Drivers). The problem today is I can’t have a simple maple mini blinking, and I lost the arduino IDE connectivity. The good part is I feel I’m closer and closer.
OS: Windows 7
___________TL;DR_______________
What did I do ? Chronologically (err, approximately)
Maple Mini from USB
► tried to use the maple mini IDE, or Arduino IDE, no success, no COM port detected.
► installed something like libwdi-1.2.4
► tried to put my computer in test mode, (DIsable_integrity_checks, etc.), with no change, so I put it back on its previous mode.
Used an Arduino Leonardo to program it.
► tried some JTAGduino and jtagbanging programs on my arduino leonardo to program the Maple Mini from pins 18 -> 22.
https://balau82.wordpress.com/2014/08/1 … g-arduino/
http://www.khjk.org/log/2013/aug/jtagbang.html
All the tests failed as the STM32 didn’t seem to answer the test programs I ran from python pyserial via the Arduino serial port.
► Tried RealTerm, with no understanding of what I was doing.
Now attached directly the Maple Mini from USB again.
► Downloaded XLoader, it was a failure as my device was not showing http://xloader.russemotto.com/
► Tried STM32 Flash loader demonstrator. http://www.st.com/web/en/catalog/tools/PF257525
was a failure too as the application didn’t see my device, whatever the configuration (bootloader, running…)
► Installed some maple drivers from https://github.com/rogerclarkmelbourne/ … le-drivers
retried using maple mini IDE, with no changes
uninstalled and installed drivers with zadig 2.1.2, i don’t know where
____________/TL;DR_____________
What’s up Now
► (Re)Installed some additional stuff for Arduino IDE with http://www.rogerclark.net/stm32f103-and … 1-5-x-ide/
Had some problem with compilation of basic sketches from the library or even from arduino basic examples, BUT ! even if my COM device was not showing, it appeared that I could program the Maple Mini. From now, that’s the last thing that really semmed to work, although I didn’t even check for a working blink program as I didn’t knew how to proceed (BOARD_LED_PIN was not defined for instance, was I supposed to simply write 33 or D33 for instance ?). I’ve just noted that the original blink program of the maple mini was deleted, that Arduino IDE could load it twice and see the maple mini in COM6, and interepreted that as a good sign. COM device also showed in windows peripheral manager.
As I wanted to push my experiment forward, I decided to learn more about how to upload programs on the Maple Mini and as DFU-Driver was installed (downloaded and used Zadig again https://community.particle.io/t/tutoria … -2015/3518) I found the leaflabs.com/docs/bootloader.html explanation and decided to use dfu-util to upload my sketch directly through USB without using Arduino IDE.
The DFU device is recognised when the maple mini is in bootloader mode (reset then but pressed immediately) and I uploaded .hex and .bin files from Keil µvision. Dfu-util says the transaction is complete, but my Keil µvision blink program is not working.
In addition, the dfu device is still showing during bootloader phase, but the COM port doesn’t show after this – the program has changed.
BUT!
Now, when I get back in Arduino IDE, the dfu device is found but I have to stay in bootloader for this and even if Arduino IDE finds the STM32, it says
“sending control message failed, a device attached to the system is not functioning.”
I finally tried to upload Arduino ccp.bin sketches from Temp directories to the Maple Mini via dfu-util, it “works” too, but I still don’t get the COM port back and Arduino IDE can’t reach the STM32 :/. I also noticed I can’t use dfu-util twice without resetting it even if the dfu device still show in windows after an upload and before a reset.
So, finally, I’d like to know :
– Is it possible to recover the initial maple behaviour to program it via Arduino IDE (as a STM32duino)
– is it possible to upload .bin to my maple mini, with something like dfu programming, just with a USB wire, that wouldn’t break the Maple mini ? Or can I import .bin to Arduino IDE to run directly the program to the maple mini ?
Lot of thanks
Ray
You are really overcomplicating things.
Did you watch any of my youtube videos?
If you want to program the board using Keil, thats fine, but I’m not sure anyone on this forum will be able to help as I don’t think anyone uses Keil.
Assuming you have not overwritten the bootloader, if you install the drivers from the drivers/win folder in the repo, the board will enumerate as Maple Dfu.
You wont get Maple serial, as the bootloader is Dfu only (this is explained in detail in many posts and my videos).
If you see a dfu device, upload a blank sketch and it should run, and you will then get the Maple serial device (the sketch provides serial, not the bootloader)
If you dont get the dfu device, chances are, you have uploaded invalid code into the sketch address and the bootloader has tried to run it and its crashed etc
in which case, google for Maple mini perpetual bootloader and put the board into that mode, which will give you dfu, and start again with the arduino ide and a blank sketch
ps. i thought the blink example in the repo worked.
To make it simple :
I don’t know how to deal with the bootloader, I just uploaded things with dfu-util while in perpetual bootloader mode so I hope it’s impossible to break things this way.
I already installed the drivers in Arduino_STM32\drivers\win\intall_drivers.bat and I’ve just redone it.
It’s been a while I’m trying to upload the blank sketch, I’ve just redone it to be sure :
In running mode, “couldn’t find the DFU device”
In perpetual bootloader mode (=led blinking and dfu showing in peripheral manager), “found it !” but “sending control message failed”
I’ll try to uninstall reinstall Arduino today, but maybe it’s the bootloader.
http://www.rogerclark.net/stm32f103-and … 1-5-x-ide/
But I still have the same issue. Dfu found but not working.
Step 6 may be what I’m looking for.
Do steps 7 -> 14 only work with the “USB to Serial route” ?
And
void setup()
{
// Set up the built-in LED pin as an output:
pinMode(BOARD_LED_PIN, OUTPUT);
pinMode(PC13, OUTPUT);
}void loop()
{
toggleLED(); // Turn the LED from off to on, or on to off
togglePin(PC13);
delay(250); // Wait for
}
But it doesn’t matter, for now I’m looking for a way to upload via dfu. I think dfu-util broke something…
Yes ! Maple mini, Orig bootloader, 17k 108k.
Did you place the Maple Mini in DFU mode?
Yes ! Let’s be sure : it’s when I press reset, then immediately after I press the button, and release it only two seconds after.
(The led blinks, and windows shows a dfu device, and arduino IDE finds it, but can’t upload to it.)
Took the blank sketch, with “USBtinyISP programmer”, but tried others too.
At the moment we are working blind.
With verbose enabled (for upload only, compliation seems to work), there’s still the same message and nothing more.
Seems like the last task isn’t terminating, I’ve waited for a while.
Sketch uses 12,100 bytes (10%) of program storage space. Maximum is 110,592 bytes.
Global variables use 3,104 bytes of dynamic memory.
A:\Stophe\Documents\Arduino\hardware\Arduino_STM32/tools/win/maple_upload.bat COM6 1 1EAF:0003 D:\Temp\build2077611308989458242.tmp/sketch_aug05a.cpp.bin
maple_loader v0.1
Resetting to bootloader via DTR pulse
Reset via USB Serial Failed! Did you select the right serial port?
Searching for DFU device [1EAF:0003]…
Assuming the board is in perpetual bootloader mode and continuing to attempt dfu programming…
Found it!
error get_status: usb_control_msg: sending control message failed, win error: Un périphérique attaché au système ne fonctionne pas correctement.
Opening USB Device 0x1eaf:0x0003…
Found Runtime: [0x1eaf:0x0003] devnum=255, cfg=0, intf=0, alt=1, name=”DFU Program FLASH 0x08005000″
Setting Configuration 1…
Claiming USB DFU Interface…
Setting Alternate Setting …
Determining device status:
In perpetual booloader mode I get these messages
maple_loader v0.1
Reset via USB Serial Failed! Did you select the right serial port?
Assuming the board is in perpetual bootloader mode and continuing to attempt dfu programming…
Resetting to bootloader via DTR pulse
Searching for DFU device [1EAF:0003]…
Found it!
Opening USB Device 0x1eaf:0x0003…
Found Runtime: [0x1eaf:0x0003] devnum=1, cfg=0, intf=0, alt=1, name=”DFU Program FLASH 0x08005000″
Setting Configuration 1…
Claiming USB DFU Interface…
Setting Alternate Setting …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
Transfer Size = 0x0400
bytes_per_hash=242
Starting download: [##################################################] finished!
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Put the board into perpetual bootloader mode and open a command window to tools/win and run
dfu-util -l
You should see this
dfu-util – (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Found DFU: [0x1eaf:0x0003] devnum=1, cfg=0, intf=0, alt=0, name=”DFU Program RAM 0x20000C00″
Found DFU: [0x1eaf:0x0003] devnum=1, cfg=0, intf=0, alt=1, name=”DFU Program FLASH 0x08005000″
(Note this is on an unmodified Maple mini)
If that seems OK.
Try compiling a blank sketch and use this command line to upload it (in perpetual bootloader mode)
dfu-util -d 0x1eaf:0x0003 -a 1 -D YOUR FILE PATH TO THE BIN FILE -R
A:\Stophe>dfu-util -l
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]
Found DFU: [1eaf:0003] ver=0201, devnum=4, cfg=1, intf=0, alt=1, name=”DFU Program FLASH 0x08005000″, serial=”LLM 003″
Found DFU: [1eaf:0003] ver=0201, devnum=4, cfg=1, intf=0, alt=0, name=”DFU Program RAM 0x20000C00″, serial=”LLM 003″
and
D:\Temp\build1002012548081470735.tmp>dfu-util -d 0x1EAF:0x0003 -a 1 -D sketch_aug06a.cpp.bin -R
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]
Invalid DFU suffix signature
A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device…
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface…
Setting Alternate Setting #1 …
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device
Download [=========================] 100% 12100 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
Resetting USB to switch back to runtime mode
acutally my previous .bat file was doing dfu-util -a1 -d 0x1EAF:0x0003 -D prg.bin
it only works with the version in the repo.
So right now I have what you had :
A:\Stophe>dfu-util -l
dfu-util – (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Found DFU: [0x1eaf:0x0003] devnum=255, cfg=0, intf=0, alt=0, name=”DFU Program R
AM 0x20000C00″
Found DFU: [0x1eaf:0x0003] devnum=255, cfg=0, intf=0, alt=1, name=”DFU Program F
LASH 0x08005000″
But there, the same message as from arduino
dfu-util – (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY
Opening USB Device 0x1eaf:0x0003…
Found Runtime: [0x1eaf:0x0003] devnum=255, cfg=0, intf=0, alt=1, name=”DFU Progr
am FLASH 0x08005000″
Setting Configuration 1…
Claiming USB DFU Interface…
Setting Alternate Setting …
Determining device status: error get_status: usb_control_msg: sending control me
ssage failed, win error: Un pÚriphÚrique attachÚ au systÞme ne fonctionne pas co
rrectement.

Edit : currently googling the thing… which is not really a success.
try another cable
try another usb port
try a different computer that does not have too much other development software etc on it.
it only works with the version in the repo.
Thats odd.
I thought the version in the repo, was the 32 bit version that I compiled on my Linux mint x32 machine.
The source for dfu is in the repo.
look in tools/src and recompile it, and see if that fixes it for you.
Note. look in the wiki, there are instructions for downloading and building the latest copy of dfu util etc,
but the sources in the repo should be fine, as they were updated yesterday with a Pull Request by @fergul to address an issue with the line endings in the automake or autoconfig scripts.
most surprised by root password request and seeing apt-get being run.
i was expecting something like wget for a tgz && tar xpf dfu*.tgz && cd dfu-util && ./autogen.sh …… etc etc type of invocation
[email protected]:~/sketchbook_stm32/hardware/Arduino_STM32/tools/src$ ./build_dfu-util.sh
Reading package lists… Done
Building dependency tree
Reading state information… Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists… Done
Building dependency tree
Reading state information… Done
build-essential is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists… Done
Building dependency tree
Reading state information… Done
libusb-1.0-0-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists… Done
Building dependency tree
Reading state information… Done
autoconf is already the newest version.
automake is already the newest version.
autotools-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
./build_dfu-util.sh: line 8: cd: dfu-util: No such file or directory
./build_dfu-util.sh: line 9: ./autogen.sh: No such file or directory
./build_dfu-util.sh: line 10: ./configure: No such file or directory
make: *** No targets specified and no makefile found. Stop.
cp: cannot stat ‘src/dfu-util’: No such file or directory
cp: cannot stat ‘src/dfu-suffix’: No such file or directory
cp: cannot stat ‘src/dfu-prefix’: No such file or directory
now i’ve copied dfu-util directory from your 060815-0842 build of yesterday, which has the source files in it
NB build-essentials should actually be build-essential, changed it here
now it builds and file shows
dfu-util: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=9224b7d0baa7b7dca954890f70197ccc032f42a5, not stripped
istr target format is an option to configure
i thought it was going to install the deb src package into dfu-util and build from that. so i’m off to google how that’s done
are you running a debian x64 system?
trying to be helpful i thought i’d attach my build tree
nope – different story tgz too large at 430k so i split the file, parts have invalid file extension
tried to the binaries – Invalid file extension: dfu-prefix
copied and renamed to *.bin – Invalid file extension: dfu-prefix.bin
stephen
There are at least 2 other Linux users, @ahull and @RickKimball , but I’m not sure what flavours of linux they use
Actually 99% of the time I use WIndows, I just tripple boot on of my machines to test Linux stuff when necessary
No issues at all uploading to the Maple mini board.
Occasionally, I have to press reset while uploading, but most of the time it works just fine.
I started out by doing a git clone of Roger’s repo. About once a week (or after he has posted an update) I do a git pull to load the latest changes.
Board: Maple Mini
Bootloader Version: “Bootloader 2.0 (20k RAM. 120k Flash)”
Sketch uses 20,628 bytes (16%) of program storage space. Maximum is 122,880 bytes.
Global variables use 4,384 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]
Opening DFU capable USB device...
ID 1eaf:0003
Run-time device DFU version 0110
Claiming USB DFU Interface...
Setting Alternate Setting #2 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 0110
Device returned transfer size 1024
Copying data from PC to DFU device
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Download [ ] 0% 0 bytes
... (bunch of lines deleted) ...
Download [=========================] 100% 20628 bytes
Download done.
state(8) = dfuMANIFEST-WAIT-RESET, status(0) = No error condition is present
Done!
It it can help, here is dfu-util-0.7.zip, although I didn’t follow the whole thread.
$ dfu-util -l
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]
Found DFU: [1eaf:0003] ver=0201, devnum=33, cfg=1, intf=0, alt=2, name="Bootloader 2.0.rc1 Upload to Flash address 0x8002000 (Maple-mini)", serial="LLM 003"
Found DFU: [1eaf:0003] ver=0201, devnum=33, cfg=1, intf=0, alt=1, name="Bootloader 2.0.rc1 Upload to Flash address 0x8005000 (Maple-mini)", serial="LLM 003"
Found DFU: [1eaf:0003] ver=0201, devnum=33, cfg=1, intf=0, alt=0, name="Bootloader 2.0.rc1 ERROR. Upload to RAM is not supported. (Maple-mini)", serial="LLM 003"
I’m really not sure what OS the OP is using.
They say they want a Linux 32 bit dfu-util, but AFIK thats what I compiled as I deliberately installed a 32 bit version of Linux Mint onto one of my machines (triple boot from an external disk), so that I could compile everything for 32 bit, as most 64 bit Linux systems run 32bit command line stuff ok (again AFIK)
But the OP was quoting file paths with “A:\” which seemed really odd, and I presumed they were running Windows with some strange mappings
But I’m not totally at a loss to what they are using and why they have such a strange system and have all sorts of issues with USB.
I’m not aware of anyone else who has come across anything like the number of issues as the OP
You call it with something like…
{wherever you installed the repo}/Arduino_STM32/tools/linux/dfu-util -D ./STM32_Blink.cpp.bin -d 1eaf:0003 --intf 0 --alt 1
Edit : ok, cable don’t change anything, and actually I don’t know how to run this on a 32bit windows XP, “install_drivers” don’t launch and then I got too many problems with compilation from the beginning… I don’t know if it’s worthy to go this way. I’m gonna find an other computer later, or check my settings in the win7 laptop I’m currently using.
Edit : you’ve been faster

Edit : Still got
Arduino : 1.6.5 (Windows XP), Carte : “Maple (Rev 3)”
“Cannot run program “{runtime.tools.arm-none-eabi-gcc.path}\bin\arm-none-eabi-g++” (in directory “.”): CreateProcess error=2, Le fichier spécifié est introuvable”
But, it doesn’t matter, I’ll come back on this later if needed. I think I tried to install all this too fast. I must have forgotten something.
They are in the drivers folder but in a sub folder.
Dont try using the installer bat, as it does not work on XP.
just use the inf files in the legacy xp sub folder
Edit : Okay I got it I think it’s this : NEVER follow that tutorial ! https://community.particle.io/t/tutoria … -2015/3518 ( ironically, it’s googling everywhere about dfu that I found it, and I was about to follow it and I thought “oh, wait! Didn’t I already do this ? What if I just uninstall this driver” )
So, I just uninstalled the zadig dfu driver and let windows install it its way. Okay maybe I’ll have to use your “install_drivers” once more, but at least now, your dfu-util seems to agree with what I’m doing.
It’s late here, but I’ll come back soon with – I hope – the happy ending debrief’ !
It was this, the zadig driver. I installed it when I didn’t know stm32duino and this weren’t linked.
Solution is to unistall it.
So easy ! Now I reinstalled the maple mini driver and everything work fine, the Com port is back.
Nothing to say, it’s perfection, thanks for the help, and sorry for this mistake !
If one day I find out how to upload keil projects on it, I’ll maybe add a word on it here, but as you say it’s not the purpose of this forum, and right now I’m gonna relearn Arduino language with your examples and wikis.
Cheers !
OK.
No worries
I’m not sure why zadig is a problem. I think I have that installed on my machine, for use with Software Defined Radio.
Anyway. I’m glad you fixed the problem.
Edit : Still got
Arduino : 1.6.5 (Windows XP), Carte : “Maple (Rev 3)”
“Cannot run program “{runtime.tools.arm-none-eabi-gcc.path}\bin\arm-none-eabi-g++” (in directory “.”): CreateProcess error=2, Le fichier spécifié est introuvable”