The STM32F103c8t6 based blue-pill is a bargain, but the learning-curve is steeper compared to Arduino, so here is what I did
Install HID-bootloader
The boards from china comes with a serial bootloader, so you need either a USB-serial-port, or an ST-Link to program it, so the first thing we will have to do is install an USB bootloader. There are plenty of guides available, but most is focusing on Windows, I don’t currently have a Windows computer, so here is what I use and do
- [DIY Guide] Flashing BluePill STM32duino Bootloader & QMK on Linux…
- a cheap STLINK-v2 clone from China
- sudo apt install stlink-tools to flash the new bootloader
- tkg_hid_generic_pc13.bin from TheKikGen/stm32-tkg-hid-bootloader.
- tkg-flash from the above link
- add an udev rule to make the bluepill in bootloader-mode accessible
st-flash --reset write stm32-tkg-hid-bootloader/F1/bootloader_only_binaries/tkg_hid_ 0x8000000
cd stm32-tkg-hid-bootloader/cli
make -f Makefile.linux
sudo install binaries_dist/tkg-flash /usr/local/bin
echo 'SUBSYSTEMS=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="beba", GROUP="plugdev", MODE:="0666"' \
| sudo dd of=/etc/udev/rules.d/49-bluepill.rules
sudo udevadm control --reload-rules
# Now plug-in the Blue-Pill
tkg-flash -info
DONE
