STM32F103C8T6 BluePill+ error "Failed uploading: no upload port provided"

Bootloader for STM32F103 and STM32F4xx micro-controllers
No special driver is required. Support for Windows, Linux and Mac Operating System
Post Reply
Bruur
Posts: 2
Joined: Fri Jan 03, 2025 2:21 pm

STM32F103C8T6 BluePill+ error "Failed uploading: no upload port provided"

Post by Bruur »

Hello all,

I've been tinkering with some STM32F1 boards since 2 weeks now. I want to use them for a project but seem to fail to program anything (except a blink through ST-link).
First I purchased some counterfeits from ali (Device ID 414 & 256kB flash on a C8 48pin model is not official STM32F1) but then I stumbled unto the WeAct seller who apparently use genuine chips, after connecting through ST-link it seems to be the truth (good reviews, device id 410, C8 with 64kB, printing on chip looks legit) they call it "BluePill plus".

It came with a USB bootloader installed (slow blink LED & showed up as Mass storage device with 2/8kB available space). I'd like to program through arduino IDE so downloaded the HID bootloader. Unfortunately my arduino IDE does not seem to be able to upload to the device.

I searched the forums for a solution but everything I tried has led to the same result:

Code: Select all

Sketch uses 23948 bytes (36%) of program storage space. Maximum is 65536 bytes.
Global variables use 4392 bytes (21%) of dynamic memory, leaving 16088 bytes for local variables. Maximum is 20480 bytes.
Failed uploading: no upload port provided
I tried:
Different methods of uploading bootloader:
- Bootloader mode by pressing Boot0 (onboard LED does not flash) > Connect ST-link to PC > downloaded .bin (STMprogrammer [Full chip erase, download file, verify, software reset enabled) > Boot 0 not pressed (Becomes pulled down: GND through 10k R) > press reset.
That works (LED fast blink & see attached image of USB viewer)
- Bootloader mode by pressing Boot0 & PA0 (onboard LED does not flash) > Connect ST-link to PC > downloaded .bin (STMprogrammer [Full chip erase, download file, verify, software reset enabled) > Boot 0 & PA0 not pressed (PA0 becomes floating, and Boot0 becomes pulled down: GND through 10k R) > disconnect.
It gives the same result as pressing only Boot0, as expected (STM's AN2606 Application note page 22 says both are a pattern to enter bootloader).

Differet methods of uploading Blink:
- (after downloading with STlink) Arduino IDE > connect USB C cable > settings as in image > download BLINK (proviced by WeAct, onboard LED = PB2) > error.
- (after downloading with UART converter)Arduino IDE > connect USB C cable > settings as in image > download BLINK (proviced by WeAct, onboard LED = PB2) > error.
- (after downloading with UART converter)Arduino IDE > connect USB C cable > Press and hold boot0, hit reset once (LED turns off) > settings as in image > download BLINK (proviced by WeAct, onboard LED = PB2) > error.

Items used:
- STM32F103C8T6 BluePill+ from WeAct: https://nl.aliexpress.com/item/10050049 ... pt=glo2nld https://github.com/WeActStudio/BluePill-Plus
Schematic through dropbox: https://www.dropbox.com/scl/fi/j3pk43uv ... 7x179&dl=0
- ST link V2 (probably clone, but has been working without fail)
(AZDelivery CP2102 USB to TTL converter)
- STMprogrammer to flash HID bootloader
- HID bootloader provided by WeAct (their LED is on PB2)
- Arduino IDE 2.3.1 (& now downgraded to 2.2.1, to see if it fixes anything)
- ST32M (official) core: https://github.com/stm32duino
- USB C data cable (I can upload from phone with the same cable)

Arduino settings used:
Image https://imgur.com/a/njibMaC

I can find the device in device manager under HID devices (named: USB input device), and USB device viewer can read the HID bootloader on it.
Image https://imgur.com/a/V7oeioV

I have no clue where to look, would someone be so kind as to help me with this issue?
by ag123 » Sat Jan 11, 2025 3:43 pm
well, you may like to try a/some of the F4x1
viewtopic.php?p=15142#p15142

I'm not sure about the HID bootloader, I've never used it. I've a 'strange' feeling that it is originally developed as there may be issues on *MS Windows* systems.

dfu-util has some dependencies and is quite hard to build on Windows
https://dfu-util.sourceforge.net/
this tool is needed to work properly with the 'maple' bootloader
dfu-util is a 'defacto' USB DFU app to flash/install a sketch bin to 'maple' (stm32f103 'maple' boards or 'bluepill' boards) with the 'maple' bootloader.
I'm not sure if stm32cube programmer can work that way as ST's DFU (device firmware update) is a bit different from 'standard' DFU.
https://www.st.com/en/development-tools ... eprog.html
ST's DFU can pass an address to ST's own on chip DFU to tell the chip where (the address) to install. But this feature is not used in the 'maple' bootloader.
stm32f4xx chips has built-in support for ST's own DFU and can be programmed directly from stm32cube programmer
the 'famous' document is AN2606 STM32 microcontroller system memory boot mode
https://www.st.com/resource/en/applicat ... ronics.pdf
those where it states has DFU, you can program them with stm32cube programmer directly using a phone usb C/A cable and those boot0 dances (i.e. set boot0).

dfu-util works very well in linux and I'm still using it with the 'maple' bootloader.

I'm not sure what is the firmware loading utility on the desktop to use with the HID bootloader.
https://github.com/Serasidis/STM32_HID_Bootloader
^ accordingly, there is something called HID flash as described

--
back on the 'WeAct' 'bluepill' stm32f103, it is most likely a real stm32 and you can program it normally using an st-link and/or usb-uart as describe earlier.
That is the 'official' way as that is the on-chip *native* supported method to flash firmware.

using custom bootloaders is 'convenient' for stm32f103 (as it can't do USB DFU on its own), but you end up needing to know how the *custom bootloader* works.
Go to full post
ag123
Posts: 1883
Joined: Thu Dec 19, 2019 5:30 am
Answers: 30

Re: STM32F103C8T6 BluePill+ error "Failed uploading: no upload port provided"

Post by ag123 »

a couple of things
- that 256k GD32F303CCT6 is a GD device chip is non-STM, few here know if it'd work, so we'd leave that to anyone else who may respond

- STM32F103C8T6 blue pill
can be programmed in about 2 common different ways
- st-link - if you have a st-link v2 programmer e.g.
https://www.adafruit.com/product/2548
this should connect the relevant pins at the 'bottom' (opposite usb) edge with 4 pins for that purpose (SWD).
Accordingly, normally pressing boot0 isn't necessary for this
if you have the SWD pins from st-link connected properly to the pins for st-link on the board.
you could use an app like stm32cubeprogrammer to flash the 'bin' file into the device
https://www.st.com/en/development-tools ... eprog.html

(to get your 'bin' file in Arduino IDE, run sketch > export compiled binary, and you should find it in your project folder in some sub-directory e.g. build)

- usb-uart serial dongle
this requires properly connecting a usb-uart dongle (get 3.3v ones) at pins PA9 (for TX on stm chip side) and PA10 (for RX on stm chip side)
so at the uart side TX should goto RX on stm, and RX side on uart should goto TX on stm. and then GND to GND
and you need to keep the bluepill board powered e.g. on a usb A (or C?) cable

next this requires setting boot0 jumper or if they give you a button, the button dance is
- press both reset and boot0
- hold boot0 release reset
- release reset 2 sec later
then you can use that same stm32cube programmer app to flash the "bin" file to the chip similarly

for this chip, for beginners it is not recommended to mess with custom 'bootloaders'.
the above 2 st-link SWD or usb-uart are the 'official' on-chip supported way to install/flash a sketch/firmware.
and using custom 'bootloaders' means you need to know what you are doing

I'm more a fan of STM32F4xx chips, I commented a little here
viewtopic.php?p=15142#p15142
e.g. stm32f401 and or stm32f411 has a USB DFU boot loader built-in
it can be programmed with the standard phone USB C (some A) cables and that stm32cube programmer
this needs setting/pressing boot0 as above but it works over a standard phone USB C cable.
it STM32F401/F411 is faster (much) more performant than stm32f103 for the same Hz (has FPU, and ART Accelerator (on chip cache), has more memory, more flash and normally cost a little more. e.g.
https://github.com/WeActStudio/WeActStu ... iSTM32F4x1

'official' stm core is here
https://github.com/stm32duino/Arduino_Core_STM32
the wiki is here
https://github.com/stm32duino/Arduino_Core_STM32/wiki

there is an 'older' libmaple core various details are covered here
viewtopic.php?t=3
viewtopic.php?t=301
viewforum.php?f=2
Last edited by ag123 on Sat Jan 11, 2025 2:27 pm, edited 2 times in total.
ag123
Posts: 1883
Joined: Thu Dec 19, 2019 5:30 am
Answers: 30

Re: STM32F103C8T6 BluePill+ error "Failed uploading: no upload port provided"

Post by ag123 »

I'm not familiar with custom HID bootloaders but that a google search returns this
https://github.com/Serasidis/STM32_HID_Bootloader

there is an 'old' one for USB DFU in the 'maple' ages, note this one is USB DFU not HID
https://github.com/rogerclarkmelbourne/ ... bootloader
and one of those tools that work with this is dfu-util
https://dfu-util.sourceforge.net/

first you need to install those (e.g. the DFU 'maple' one) using st-link or usb-uart as in prior comment.
after installing it successfully, this custom bootloader programs over a standard usb-A (or C) phone cable.

After that, you need to build your sketch for the 'maple' (or also called 'stm32duino' bootloader) (i.e. it leave some space away from the bootloader)
and the programming (e.g. using dfu-util) needs to happen after you press reset on the blue pill and when it blinks quite fast. after the 1st few seconds, it runs the sketch and if you want to try programming it again you need to reset the board again.

again, these are 'not for beginners'

to flash those boot loaders you need to go back to my prior comment.
custom boot loaders are not recommended for this chip unless you know what you are doing.

--
off-topic:
there is an interesting blurb about fakes and 'clones' on WeAct repo for this board
https://github.com/WeActStudio/BluePill-Plus
Recently, online shopping platforms have seen a large number of counterfeits, that is, pirated copies. We found that these counterfeits do not have WeAct && version Numbers on the back.And the boards are not lead-free, and we all know that lead is bad for you.The chips are not the latest batch, or even refurbished.Not only production materials, and production quality closes nevertheless, factory inspection to elaborate (we have a special factory program to test whether each hardware qualified), so that customers in the process of using pirated will appear all sorts of puzzling problem, increase the learning cost, harm the interests of themselves, but also severely damage our WeAct Studio product image.The original is not easy, hope everyone more support!
on AliX I think order an arbitrary 'blue pill' stm32f103, in all chances it may not be a stm one.
it'd seem WeAct is more honest about it and they likely don't ship fakes. they'd at least tell you like if that is a GD32 it is a GD32

but going back to that I'm more 'pissed' about getting 'fakes' or 'clones' if the original ad claims to be a real stm32f103 and i get a 'clone' or fake
I 'give up' and simply get stm32f4xx mostly.
Bruur
Posts: 2
Joined: Fri Jan 03, 2025 2:21 pm

Re: STM32F103C8T6 BluePill+ error "Failed uploading: no upload port provided"

Post by Bruur »

ag123 wrote: Sat Jan 11, 2025 2:14 pm on AliX I think order an arbitrary 'blue pill' stm32f103, in all chances it may not be a stm one.
it'd seem WeAct is more honest about it and they likely don't ship fakes. they'd at least tell you like if that is a GD32 it is a GD32

but going back to that I'm more 'pissed' about getting 'fakes' or 'clones' if the original ad claims to be a real stm32f103 and i get a 'clone' or fake
I 'give up' and simply get stm32f4xx mostly.
Yes, I did not expect it to influence the end product this much since buying a fake arduino is still going to be usable in some way.

I noticed the first ones being counterfeit and that's why I bought the WeAct ones: it has the brand name and version on them so I feel confident that they are genuine.

In my search to help me with my problems I ran into a post saying to stay away from maple bootloader (roger's) since it's abandoned. I have bought several copies: so I'll try your suggestion just to see if nothing else works that I can get it to work that way at least.
Thank you for your reply.
ag123
Posts: 1883
Joined: Thu Dec 19, 2019 5:30 am
Answers: 30

Re: STM32F103C8T6 BluePill+ error "Failed uploading: no upload port provided"

Post by ag123 »

well, you may like to try a/some of the F4x1
viewtopic.php?p=15142#p15142

I'm not sure about the HID bootloader, I've never used it. I've a 'strange' feeling that it is originally developed as there may be issues on *MS Windows* systems.

dfu-util has some dependencies and is quite hard to build on Windows
https://dfu-util.sourceforge.net/
this tool is needed to work properly with the 'maple' bootloader
dfu-util is a 'defacto' USB DFU app to flash/install a sketch bin to 'maple' (stm32f103 'maple' boards or 'bluepill' boards) with the 'maple' bootloader.
I'm not sure if stm32cube programmer can work that way as ST's DFU (device firmware update) is a bit different from 'standard' DFU.
https://www.st.com/en/development-tools ... eprog.html
ST's DFU can pass an address to ST's own on chip DFU to tell the chip where (the address) to install. But this feature is not used in the 'maple' bootloader.
stm32f4xx chips has built-in support for ST's own DFU and can be programmed directly from stm32cube programmer
the 'famous' document is AN2606 STM32 microcontroller system memory boot mode
https://www.st.com/resource/en/applicat ... ronics.pdf
those where it states has DFU, you can program them with stm32cube programmer directly using a phone usb C/A cable and those boot0 dances (i.e. set boot0).

dfu-util works very well in linux and I'm still using it with the 'maple' bootloader.

I'm not sure what is the firmware loading utility on the desktop to use with the HID bootloader.
https://github.com/Serasidis/STM32_HID_Bootloader
^ accordingly, there is something called HID flash as described

--
back on the 'WeAct' 'bluepill' stm32f103, it is most likely a real stm32 and you can program it normally using an st-link and/or usb-uart as describe earlier.
That is the 'official' way as that is the on-chip *native* supported method to flash firmware.

using custom bootloaders is 'convenient' for stm32f103 (as it can't do USB DFU on its own), but you end up needing to know how the *custom bootloader* works.
Post Reply

Return to “STM32 HID bootloader”