ST-Link V2 clone – ~US$2.75 from Aliexpress “BluePill” STM32F103C8 clone – ~US$2.75 from Aliexpress Note: Purchase the C8 version not the slightly cheaper C6 and a PC13 pcb version as marked in the photo above on the right near B8 B9 USB A to Micro USB cable – ~US$1 from Aliexpress 1 x 1K8 1/2W metal film resistor – US$1 (8off) from Jaycar RR0578 or Aliexpress Arduino IDE and the STM32 V2.2.0 addon installed via the IDE board manager STM32CubeProgrammer – free with registrationįor the USB to Serial Converter 2 x 1K 1/2W metal film resistor – US$1 (8off) from Jaycar RR0572 or Aliexpress 2 x Female to Male Jumper Wires – US$1.5 from Aliexpress Heat Shrink tubing to suit resistors (3mm dia) – US$2 from Jaycar WH5532 or Aliexpress STM32_Serial1Passthrough.ino This Arduino sketch needs the following library to be installed via the Arduino IDE Library Manager:- SafeString V4.1.14+Īlternative Programming Methods hid_generic_pc13.bin (zipped) HID bootloader from OR generic_boot20_pc13.bin (zipped) Maple bootloader from. Scanning through this project you may well decide that unless you really want to program STM32 boards, this process just has too many steps to be worth the effort to avoid buying a ready made USB to Serial converter for US$6 or less. The third method needs a Maple COM driver.
In second method the USB connection looks like a USB Input Device and so should work on Mac and Linux as well. While this project was completed on a Windows 7 machine, the Arduino IDE and STM32CubeProgrammer are available for Windows 32 and 64 and Mac and Linux as well and so at least the first programming method should also work for those machines. The bootloaders used are pre-compiled bins and the ST-Link V2 is driven by the STM32CubeProgrammer. This project, like the revised Very Low Power BLE project, avoids source code builds (which are messy on Windows) for the various tools needed. This project fore fills that role for an addition few $'s and uses the same micro USB cable. What was lacking was a means of displaying the BLE modules Serial debug msgs on the computer. That project uses an in-expensive ST-Link V2 / BluePill combination to build an CMSIS-DAP replacement programmer.
This project is a addendum to the Very Low Power BLE project which is being revised to use currently available programming tools and nRF52 modules. They all use an inexpensive ST-Link V2 clone as part of the setup to program STM32 cpu's via the Arduino IDE.
One of the complications of programming STM32 boards is, in addition to the various code tools, is the myriad ways the compiled code can be uploaded to the board. This project programs an inexpensive “BluePill” (STM32F103C8) board as a USB to Serial (115200) converter using the Arduino IDE. The program runs (I added an LED toggle) but no com port is detected.įrom what I have found a VCP driver is built into the Mac OS and so a driver isn't needed.Parts List Preparing the “BluePill” - Step 1 Preparing the ST-Link V2 - Step 2 Installing the STM32 Arduino IDE add on - Step 3 Installing the SafeString Library for the millisDelay class - Step 3 Tools Menu Settings - Step 4 Programming with STM32CubeProgrammer and ST-Link V2 - Step 5 Programming via the HID bootloader - Step 6 Programming via the Maple bootloader - Step 7 Installing the Maple Drivers - Step 7 Programming the “BluePill” as a USB to Serial Converter - Step 9 Wiring up the USB to Serial connection - Step 9 Introduction Then I disconnect the ST Link, and plug the BluePill in via USB. It compiles and uploads without any problems. (11.6.5) Įvery step is followed and duplicated. I have been using this example, to send text from the BluePill, through the USB to my Mac. **UPDATE #2: The SM32F105 need PA9 to be connected via a voltage divider so that it has <4v, then it works!!!!**Now to get the STM32F105 working. Just to experiment, I removed the 2K resistor and it still works on my Mac and Win 7+10 PCs. Then I tried a different USB cable.Results: It works!!! I suspect is was a "power only" or bad USB cable. The results in a 1.6K pull up which should be close enough to the spec of 1.5KResult: No difference :( UPDATE: FIXED, USB WORKS!! The issue: Bad USB or power only USB cable.I added a 2K resistor in parallel with the 10K on the D+ pull up.