Bluepill still blinks fast after burning roger's bootloader

STM32duino bootloader aka Maple bootloader
Post Reply
jim_le
Posts: 2
Joined: Sat Jun 05, 2021 3:43 pm

Bluepill still blinks fast after burning roger's bootloader

Post by jim_le »

Hey guys, I'm using a bluepill and I want to use Roger's bootloader because it's convenient. I am attempting to burn the bootloader to the bluepill thru FTDI but it can't connect to the bluepill, the error is "can't init...". When using st-link to upload my code, it blinks fast for about 2secs and then suddenly turning off instead of slowing down and then stop after 5sec or so. The connection to the st-link utility is stopped as well. Here is what I had:
- the bluepill from china. I used it to try some programs before with st-link.
- downloaded .bin file from Roger's Github
- I've checked the resistors on my board and they have right values.
- I have the FTDI from my friend and he has checked it so it should work properly.
Please let me know what I have done wrong.
Thanks in advance!
Edit: I figured out it is CS32F103 version because its CPUID is 0x2ba01477. Maybe it would be helpful to diagnose my case!
Last edited by jim_le on Sun Jun 06, 2021 10:40 am, edited 1 time in total.
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Bluepill still blinks fast after burning roger's bootloader

Post by ag123 »

if it blinks fast, then blinks slow, congrats you *may* have installed the bootloader.
the next thing is to run

Code: Select all

dfu-util -l
if you don't get any dfu devices listed, maybe it isn't roger's bootloader
jim_le
Posts: 2
Joined: Sat Jun 05, 2021 3:43 pm

Re: Bluepill still blinks fast after burning roger's bootloader

Post by jim_le »

ag123 wrote: Sat Jun 05, 2021 4:46 pm if it blinks fast, then blinks slow, congrats you *may* have installed the bootloader.
the next thing is to run

Code: Select all

dfu-util -l
if you don't get any dfu devices listed, maybe it isn't roger's bootloader
In my case, it blinks fast and then suddenly turn off the LED. I don't get any dfu device as well!
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Bluepill still blinks fast after burning roger's bootloader

Post by mrburnette »

The BluePill board (original) is identified here:
https://stm32duinoforum.com/forum/wiki_ ... _Pill.html
and there is a link to installing the bootloader: which unfortunately no longer resolves back into stm32duinoforum.com

However, I seem to remember at least one YouTube video, maybe more.

But, IMO, and I have worked with these things for years, it is simply a better experience to use the internal chip serial bootloader. It does require you to move the jumpers around, but the DFU bootloader in Roger's bootloader is and always has been problematic, even with the Maple Mini clone where the best I can remember is something like a 90% success rate.

Ray

Image
Using the serial bootloader burned into the STM32F103xxxx
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Bluepill still blinks fast after burning roger's bootloader

Post by ag123 »

normally these are the steps for a *beginner*
there are lots of info about these in the *read this first*
viewtopic.php?f=2&t=301
and *faq* links
viewtopic.php?f=2&t=3
then there is google / bing etc

the usual steps to proceed are as follows, try what is suggested by @ray, use a *usb-uart or st-link v2 dongle*
and install your *sketch* firmware. this is the first step.
make a blink sketch and make it blink in a pattern that you can expect. e.g. 2 x 1 second blinks then followed by 10 - 1/10 sec blinks etc.
these can be done with

Code: Select all

delay( msecs)
, you won't need a timer for that. after you have assured yourself that you can install a sketch
using uart or st-link v2 dongle.

then try that roger's bootloader, the hints are in those *read this first* and *faq* links.
e.g. roger did an enhancement that you can put his dfu bootloader in 'perpetual' mode
http://docs.leaflabs.com/static.leaflab ... oader-mode
https://www.youtube.com/watch?v=rvNIeKuXsxM
that can be done by setting *boot1* with roger's dfu bootloader.

then you need dfu-util
http://dfu-util.sourceforge.net/

and if you are in windows there are installation instructions to be done
https://github.com/rogerclarkmelbourne/ ... stallation

and the sketch / firmware bin file install command is something like
check that the DFU devices are found

Code: Select all

dfu-util -l
then flash away

Code: Select all

dfu-util -a 2 -RD sketch.bin
yes you only need a usb cable for this, the usb-uart or st-link dongle isn't needed after you get this correct
u'd get the convenience only after you get over all the confusion. it is mainly useful, if you are flashing 'direct' from the adruino ide.
or commonly reuse the same bluepill for different sketches / things. just keep those bin files handy and flash away each time.

there is this utopian dream about iot world becoming *software*, need blinky flash blinky sketch, usb-uart serial, flash usb-serial sketch, need oscilloscope flash oscilloscope sketch, need a ili9341 lcd 'driver' flash ili9341 sketch, need calculator flash calculator sketch, need web cam flash web cam sketch and reconnect the wires, need a 3d printer flash a 3d printer sketch, it is the same bluepill / board. roger's bootloader (and initially from leaflabs) and more importantly *stm32duino(s)* is making this come true.
for the stm32f4xx boards, just a finger dance or setting boot0 would do. DFU is built-in in the stm32f4xx series.

these days it is going beyond that using OTA updates, but that's only for the bluetooth LE enabled socs e.g. stm32wb and for this only the official stm core works. that's how all the smart watches / fitness trackers are doing it.
literally you could re-write that whole firmware say install stm32duino if you know the soc underneath.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: Bluepill still blinks fast after burning roger's bootloader

Post by mrburnette »

ag123 wrote: Sun Jun 06, 2021 7:34 pm ...
yes you only need a usb cable for this, the usb-uart or st-link dongle isn't needed after you get this correct
u'd get the convenience only after you get over all the confusion. it is mainly useful, if you are flashing 'direct' from the adruino ide.
or commonly reuse the same bluepill for different sketches / things. just keep those bin files handy and flash away each time.
...
there is this utopian dream about iot w...
If you use a USB-->Serial adapter, you still only have a USB cable. Plus, you get the benefit of not having "any" flash taken by the bootloader and 0% chance of overwriting the bootloader. And, yes, it works from the ArduinoIDE and no magic is involved.

As ag123 and I have known each other for years, I have no problem saying that the "utopian dream" may be illegal in your country and in many States in the U.S.A. Check it out here.

Ray
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: Bluepill still blinks fast after burning roger's bootloader

Post by dannyf »

a vote for st-link here. no need for stinky bootloaders, :)
Post Reply

Return to “USB bootloader”