[SOLVED] Problems with the bootloader

STM32duino bootloader aka Maple bootloader
stevestrong
Posts: 1509
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by stevestrong » Tue Jul 18, 2017 9:38 pm

In order the DFU upload to work you should use the "STM32duino bootloader" upload option, AND you have to close the USB serial COM port before upload.

The reason for this is that a magic sequence is sent over USB serial (virtual COM port) by the dfu util which "software" resets the boards. If the COM port is busy, the magic sequence cannot be sent, hence no reset. In this case you must reset manually the board.

This behavior is currently "normal".

universam10
Posts: 19
Joined: Sun Jan 03, 2016 8:35 am
Location: Germany

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by universam10 » Wed Jul 19, 2017 6:49 am

Of course you are totally correct, you made me though laugh it would be a shame as an IT guy... :lol:
Well actually, if one has the serial port open, you will get an immediate error that the port is in use which is then obvious!

What I am referring to is that I always have to wait to this point

Code: Select all

maple_loader v0.1
Resetting to bootloader via DTR pulse
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...

Searching for DFU device [1EAF:0003]...
and then I am to press reset for the maple_loader to find the DFU device!
This is not true on my other machine with W10/32bit.

Nevertheless, I have to admit that I am not using Arduino at all but only PlatformIO, so there might be an issue in this regard.

stevestrong
Posts: 1509
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by stevestrong » Wed Jul 19, 2017 8:27 am

universam10 wrote:
Wed Jul 19, 2017 6:49 am
Nevertheless, I have to admit that I am not using Arduino at all but only PlatformIO, so there might be an issue in this regard.
Oh, why don't you say so from the beginning?
PIO uses a different dfu loader and upload script, that's why it will not work.
I think I posted somewhere in the forum how to solve this, so you better search for it :mrgreen:

universam10
Posts: 19
Joined: Sun Jan 03, 2016 8:35 am
Location: Germany

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by universam10 » Wed Jul 19, 2017 9:07 am

Not really helpful on 1300 posts ;)

I've posted the underlying code which is run that is the maple_loader, taken from Arduino.

stevestrong
Posts: 1509
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by stevestrong » Wed Jul 19, 2017 11:39 am

Read beginning from this post: viewtopic.php?f=41&t=728&start=40

dackley
Posts: 12
Joined: Mon Jul 17, 2017 9:43 pm

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by dackley » Mon Aug 07, 2017 5:12 am

Please help me, I'm having a problem getting the Blue Pill Bootloader to work on my Windows 10 x64 system. I downloaded the generic_boot20_pc13.bin from the latest Github "Latest commit e851e8a 6 days ago" and downloaded it to my Blue Pill STM32F103C8 board. The board shows up in the Device Manager using "Show hidden devices" as hidden: "Other devices" "Maple 003" (both with ?) and non-hidden "Ports (COM & LPT)" "USB Serial Device (COM4)". I'm trying to download the the File > Examples > 01.Basic > Blink Sketch, and my setup is - Tools > Board: "Blue Pill F103C8", Upload method: "STM32duino bootloader", Port: "COM4". I always get the following results no matter when I click the reset button:
-----------------------------------------------------------------------------------------------------------------------------
Sketch uses 17168 bytes (26%) of program storage space. Maximum is 65536 bytes.
Global variables use 4796 bytes (23%) of dynamic memory, leaving 15684 bytes for local variables. Maximum is 20480 bytes.
maple_loader v0.1
Resetting to bootloader via DTR pulse
Searching for DFU device [1EAF:0003]...
dfu-util - (C) 2007-2008 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Couldn't find the DFU device: [1EAF:0003]
------------------------------------------------------------------------------------------------------------------------------

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

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by RogerClark » Mon Aug 07, 2017 6:43 am

Did you load the drivers ? I presume so, because you say its appearing as Maple Serial ??

Did you select the COM port in the IDE ?

If you open the serial terminal in the IDE, with the COM post selected, do you see it printing an information message (the default bootloader does this until you upload a sketch)

dackley
Posts: 12
Joined: Mon Jul 17, 2017 9:43 pm

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by dackley » Mon Aug 07, 2017 11:31 am

Thanks for the reply.
Yes the driver is loaded, I selected the COM port, and yes I'm getting the "Congratulations, you have the ..." message over and over. As it goes through the process I hear two beeps close together at about the same time as the log says "Resetting to bootloader via DTR pulse","Searching for DFU device [LEAF:0003]...", then nothing in the log until "dfu-util - (C) 2007-2008...".
If I were to guess, I'd say maybe the bootloader isn't giving the PC long enough to get through whatever it does before the Arduino IDE/DFU has time to start the download process.

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

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by RogerClark » Mon Aug 07, 2017 12:09 pm

Normally dfu waits for ages

Open your device manager and see if the dfu device appears briefly

Another thing you can do to upload if the sketch is not resetting into the bootloader is to unplug the USB

Tell the IDE to upload, wait for the compile to finish and the upload attempt to start, then plug in the board

On my W7 machine it then uploads almost instantly

But perhaps W10 is slower than W7

dackley
Posts: 12
Joined: Mon Jul 17, 2017 9:43 pm

Re: Blue pill's Bootloader - what's goin' on .. ???

Post by dackley » Mon Aug 07, 2017 5:31 pm

Well I opened the Device Manager, plugged in the Blue Pill STM32F103C8 board, and the "Other devices" "Maple 003" showed up briefly as expected.
I then tried unplugging the board after the Sketch finished compiling, but unfortunately still no luck.
The board continues to send the "Congratualtions, ...." message on the COM port.
By the way, a few weeks ago the earlier bootloader worked, but then it quit working after I had some Windows 10 updates. I also noticed that if deleted the "Other devices" "Maple 003" and "Ports (COM & LPT)" "USB Serial Device (COM4)" devices and then plugged in the board I got two "Setting up device" messages when Windows 10 re-installed these two devices. I don't know if this was happening before or not, but I thought I'd mention it.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest