You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Please add support for Black Pill F401CC Device #23
changed the title [-]Nothing on USB after Update Hid Bootloader Stm32F407CC Using Stm32Cube Thru StlinkV2[/-][+]Please add support for Black Pill F401CC Device[/+]on Nov 2, 2019
@roboticboyer The WeAct Bootloader doesn't seem to integrate with Arduino IDE like the HID Bootloader does. Not only that, their fork of the HID Bootloader modifies the flag check, and thus also doesn't work with the HID Bootloader upload method in the Arduino IDE. I managed to get a working version, but I am unsure if it qualifies to be be merged into here.
I have a Black Pill F401CC
I have uploaded your hid_bootloader.bin file but the HID 2.2 uploader is not able to find the usb devide 1209:BEBA
When I connect the blackpill there is only 0483:df11
I tried with DFU: ./dfu-util -a 0 -s 0x08000000 -D hid_bootloader.bin
and: ./stm32CubeProg.sh 2 hid_bootloader.bin -g
Also using an ST-Link programmer: ./stm32CubeProg.sh 0 hid_bootloader.bin -g
I used dfu-util to write it to the board. One thing I'll note is that I'm using a 411, instead of a 401. May I suggest that you look at the changed code and see if you can build it locally instead of using the one I built, given that I am a beginner myself, so my changes might need reviewing before you use them.
Thank you
I'll check and recompile the firmware for the 401
Please only confirm that the parameters of dfu-util are correct: ./dfu-util -a 0 -s 0x08000000 -D hid_bootloader.bin
Is required to press the Button PA0 to enter in Boot mode?
Those guys at WeAct are shooting themselves in the foot, as what people are interested in is Arduino IDE support, which cannot happen if the flashing tools are forked from BSD-licensed software and made proprietary.
how can i upload sketches without having to press a physical button on the device, etc?
A compilation output of an Arduino sketch is a firmware for the device. A bootloader is firmware which helps you update the 'application' firmware (e.g. the Arduino sketch).
The easiest / most reliable way I've found is to use an STLink.
Whereas, I've found DFU to be ... finicky; sometimes only working if I hold down both the BOOT and NRST buttons for a long time (30s+), or not work at all. (Different levels of success depending on the OS / which particular dev board is used).
This HID bootloader in this repo (IIUC) would allow updating the firmware when used with the hid flashing program (also in this repo). This particular fork of the HID bootloader is geared towards Arduino. -- The benefit being, you could update the firmware without needing to push any buttons on the dev board. - If you flash the bootloader with the correct configuration, this should let you upload from Arduino IDE.
well i have the weact f411 here on platformio. and have been flashing it in dfu mode. pressing the button
could plugin an stlink i suppose. its just more wires / cables
but if you think i can have hid flashing without needing the buttons for this device? because that might seem worth it
can then add a custom uploader cmdline in the platformio.ini file to call it
however what confuses me, and makes me ask about butonless HID mode is because the README seems to say i still need to press some button... key instead of boot0, same difference really.
in which case it does not achieve the set goal, and is no better than dfu mode for me. sorry for the confusion, but i am really confused by this. wherever i look online about it for this particular board :)
however what confuses me, and makes me ask about butonless HID mode is because the README seems to say i still need to press some button... key instead of boot0, same difference really.
so presumably, the bootloader can be entered by setting the value & triggering a reset from the firmware, and could be entered without pushing a button.
This is what makes sense to me; I haven't tried it. I don't have any significant experience with embedded development; so I'd suggest the search terms "stm32 software reset"; and/or figure out how to set a particular register to a particular value in the stm32duino port.
Again, the bootloader in this repo enters the HID bootloader if the boot_1 is low (i.e. <key> is held down), or "incoming magic number" (value of a particular register has a specific value) when the bootloader starts. i.e. after a reset or when the device is plugged in. - As you point out, the "key held down" part isn't more useful than the built-in DFU; but I'd expect it's possible to write to a register and reset the MCU from the firmware.
I wrote some notes how to use the WeAct Bootloader @samveen where is available your bin file of the modified bootloader?
I was able to get f401cc working with platformio by following some of the above steps by @roboticboyer
In wsl or linux objcopy -Iihex -j .sec1 -Obinary WeAct_HID_Bootloader_F4x1.hex WeAct_HID_Bootloader_F4x1.bin dfu-suffix -a WeAct_HID_Bootloader_F4x1.bin
then in windows .\st-flash.exe write .\WeAct_HID_Bootloader_F4x1.bin 0x8000000
to put in the bootloader mode press nrst button while boot0 is pressed. you should see STM32 BOOTLOADER in windows device manager when it is in the bootloader mode.
probably not much related here. But recently I changed to using tinyuf2 instead of the hid bootloader for both f401 and f411 blackpills. much easier to get into the bootloader mode - just double tap the reset button.
can be flashed easily with .\st-flash.exe write .\tinyuf2-stm32f401_blackpill-0.5.0.bin 0x8000000
I used dfu-util to write it to the board. One thing I'll note is that I'm using a 411, instead of a 401. May I suggest that you look at the changed code and see if you can build it locally instead of using the one I built, given that I am a beginner myself, so my changes might need reviewing before you use them.
I recompiled you version but can't get it working.
I used dfu-util to write it to the board. One thing I'll note is that I'm using a 411, instead of a 401. May I suggest that you look at the changed code and see if you can build it locally instead of using the one I built, given that I am a beginner myself, so my changes might need reviewing before you use them.
I recompiled you version but can't get it working.
It's been quite some time since I touched it. Things may have changed a lot during that time. Please check the errors and see if you are able to fix them, as I haven't touched this code for more than 2 years.
Activity
[-]Nothing on USB after Update Hid Bootloader Stm32F407CC Using Stm32Cube Thru StlinkV2[/-][+]Please add support for Black Pill F401CC Device[/+]roboticboyer commentedon Jul 18, 2020
I suggest to use the WeAct Bootloader. In case is used a Black Pill is required to press the P0 button to enter in the boot mode
There is also a HID Bootloader forked from the Serasidis' one but not tested from me
samveen commentedon Aug 6, 2020
@roboticboyer The WeAct Bootloader doesn't seem to integrate with Arduino IDE like the HID Bootloader does. Not only that, their fork of the HID Bootloader modifies the flag check, and thus also doesn't work with the HID Bootloader upload method in the Arduino IDE. I managed to get a working version, but I am unsure if it qualifies to be be merged into here.
roboticboyer commentedon Aug 6, 2020
I wrote some notes how to use the WeAct Bootloader
@samveen where is available your bin file of the modified bootloader?
samveen commentedon Aug 7, 2020
@roboticboyer I didn't put it up anywhere, expecting that people might be more comfortable building it themselves. However you can find it via this google drive link
Edit: I figured out attachments 🤦♂️
hid_bootloader.bin-2.2.2-6-g296db49.gz
roboticboyer commentedon Aug 21, 2020
I have a Black Pill F401CC
I have uploaded your hid_bootloader.bin file but the HID 2.2 uploader is not able to find the usb devide 1209:BEBA
When I connect the blackpill there is only 0483:df11
I tried with DFU:
./dfu-util -a 0 -s 0x08000000 -D hid_bootloader.binand:
./stm32CubeProg.sh 2 hid_bootloader.bin -gAlso using an ST-Link programmer:
./stm32CubeProg.sh 0 hid_bootloader.bin -gWhere I'm wrong?
samveen commentedon Aug 28, 2020
I used
dfu-utilto write it to the board. One thing I'll note is that I'm using a411, instead of a401. May I suggest that you look at the changed code and see if you can build it locally instead of using the one I built, given that I am a beginner myself, so my changes might need reviewing before you use them.roboticboyer commentedon Aug 29, 2020
Thank you
I'll check and recompile the firmware for the 401
Please only confirm that the parameters of dfu-util are correct:
./dfu-util -a 0 -s 0x08000000 -D hid_bootloader.binIs required to press the Button PA0 to enter in Boot mode?
samveen commentedon Aug 29, 2020
I used
dfu-util -a 0 -d 0483:df11 -s 0x8000000:mass-erase:force -D hid_bootloader.bin -t 1024zoobab commentedon Feb 15, 2021
I have a WeAct BlackPill:
http://zoobab.wikidot.com/stm32f401-devboard
Those guys at WeAct are shooting themselves in the foot, as what people are interested in is Arduino IDE support, which cannot happen if the flashing tools are forked from BSD-licensed software and made proprietary.
dreamcat4 commentedon Apr 12, 2021
hello, sorry am a bit new to this device, and just wanted to know:
rgoulter commentedon Apr 12, 2021
A compilation output of an Arduino sketch is a firmware for the device. A bootloader is firmware which helps you update the 'application' firmware (e.g. the Arduino sketch).
The easiest / most reliable way I've found is to use an STLink.
Whereas, I've found DFU to be ... finicky; sometimes only working if I hold down both the BOOT and NRST buttons for a long time (30s+), or not work at all. (Different levels of success depending on the OS / which particular dev board is used).
This HID bootloader in this repo (IIUC) would allow updating the firmware when used with the hid flashing program (also in this repo). This particular fork of the HID bootloader is geared towards Arduino. -- The benefit being, you could update the firmware without needing to push any buttons on the dev board. - If you flash the bootloader with the correct configuration, this should let you upload from Arduino IDE.
dreamcat4 commentedon Apr 12, 2021
well i have the weact f411 here on platformio. and have been flashing it in dfu mode. pressing the button
could plugin an stlink i suppose. its just more wires / cables
but if you think i can have hid flashing without needing the buttons for this device? because that might seem worth it
can then add a custom uploader cmdline in the platformio.ini file to call it
however what confuses me, and makes me ask about butonless HID mode is because the README seems to say i still need to press some button... key instead of boot0, same difference really.
in which case it does not achieve the set goal, and is no better than dfu mode for me. sorry for the confusion, but i am really confused by this. wherever i look online about it for this particular board :)
hehe
rgoulter commentedon Apr 12, 2021
Where in the README does it say that?
dreamcat4 commentedon Apr 12, 2021
in the WeAct one here
https://github.com/WeActTC/MiniSTM32F4x1/tree/master/Soft/WeAct_HID_FW_Bootloader
rgoulter commentedon Apr 12, 2021
Ah, that's right. Sorry, I haven't yet tried this bootloader. I recall seeing the code has a comment in the entrypoint:
https://github.com/Serasidis/STM32_HID_Bootloader/blob/master/bootloader/F4/Src/main.c#L138
(Per WeAct's changes, the WeAct MiniF4's
<key>is theboot_1being referred to).so presumably, the bootloader can be entered by setting the value & triggering a reset from the firmware, and could be entered without pushing a button.
dreamcat4 commentedon Apr 12, 2021
how?
you lost me again. sorry i could not follow that explanation
rgoulter commentedon Apr 12, 2021
This is what makes sense to me; I haven't tried it. I don't have any significant experience with embedded development; so I'd suggest the search terms "stm32 software reset"; and/or figure out how to set a particular register to a particular value in the stm32duino port.
Again, the bootloader in this repo enters the HID bootloader if the boot_1 is low (i.e.
<key>is held down), or "incoming magic number" (value of a particular register has a specific value) when the bootloader starts. i.e. after a reset or when the device is plugged in. - As you point out, the "key held down" part isn't more useful than the built-in DFU; but I'd expect it's possible to write to a register and reset the MCU from the firmware.dreamcat4 commentedon Apr 12, 2021
so this is... some WIP not finished yet?
stm32duino/Arduino_Core_STM32#1118 (comment)
in PR #710 ?
pathnirvana commentedon Apr 24, 2021
I was able to get f401cc working with platformio by following some of the above steps by @roboticboyer
In wsl or linux
objcopy -Iihex -j .sec1 -Obinary WeAct_HID_Bootloader_F4x1.hex WeAct_HID_Bootloader_F4x1.bin dfu-suffix -a WeAct_HID_Bootloader_F4x1.binthen in windows
.\st-flash.exe write .\WeAct_HID_Bootloader_F4x1.bin 0x8000000finally in platformio.ini file
[env:blackpill_f401cc] platform = ststm32 board = blackpill_f401cc framework = arduino upload_protocol = dfuto put in the bootloader mode press nrst button while boot0 is pressed. you should see STM32 BOOTLOADER in windows device manager when it is in the bootloader mode.
hope this helps someone
pathnirvana commentedon Jul 26, 2021
probably not much related here. But recently I changed to using tinyuf2 instead of the hid bootloader for both f401 and f411 blackpills. much easier to get into the bootloader mode - just double tap the reset button.
can be flashed easily with
.\st-flash.exe write .\tinyuf2-stm32f401_blackpill-0.5.0.bin 0x8000000also the releases can be downloaded from https://github.com/adafruit/tinyuf2/releases/
sandmix commentedon Sep 14, 2022
So for now only one working option to flash blackpill through USB without touching it is WeAct_HID_Bootloader
sandmix commentedon Sep 22, 2022
I recompiled you version but can't get it working.
samveen commentedon Sep 30, 2022
It's been quite some time since I touched it. Things may have changed a lot during that time. Please check the errors and see if you are able to fix them, as I haven't touched this code for more than 2 years.
fufu930 commentedon Dec 18, 2024
Might be interested in - WeActStudio/WeAct_HID_Bootloader_F4x1#2 (comment)
😊