Skip to content
Eric Helgeson edited this page Jun 19, 2021 · 16 revisions

When flashing you have two options:

  1. Flash by setting up the IDE and re-compiling and programming. If you are a developer and plan to contribute this method is what you should use.

  2. You may also flash the .bin file directly from STM32CubeProgrammer. Use this method if you are not a developer and just wish to get the code to the BluePill.

Using STLink v2 (preferred)

Setup STLinkV2

Be sure to buy the "Clone" STLink V2 programmer - the official one does not seem to work as well.

  • Make sure the STLinkV2 is up to date - Latest Firmware

  • Connect pins SWDIO(2), GND(4), SWCLK(6), and 3.3v(8) from the programmer to the Blue Pill.

    • NOTE: These are not the same as Serial ports.

Procedure (STM32CubeProgrammer)

  • Remove SD Card
  • Open STM32CubeProgrammer
  • Move the BOOT0 jumper (furthest from the reset button) to 1
  • Push the reset button on the BluePill
  • Click Connect in STM32CubeProgrammer
  • Select the .bin file and program.
  • Move BOOT0 jumper back to 0
  • Push the reset button on the BluePill
  • You should see the LED PC_13 flashing indicating no SD Card detected.

Procedure (PlatformIO)

  • Remove SD Card
  • Move the BOOT0 jumper (furthest from the button switch) to 1
  • Push the reset button on the BluePill
  • Run the PlatformIO: Upload task.
    • Expected output:
Uploading .pio/build/genericSTM32F103C8/firmware.elf
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.10.0+dev-00378-ge5be992df (2020-06-26-12:31)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 1

0
hla_swd
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x08000194 msp: 0x20000690
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **.      <-- Everything flashed OK
** Resetting Target **
  • Move BOOT0 jumper back to 0
  • Push the reset switch on the BluePill
  • You should see the LED PC_13 flashing indicating no SD Card detected.

The following YouTube video demonstrates the steps of flashing & updating your BlueSCSI https://www.youtube.com/watch?v=bRLAOts_MTM

Trouble Shooting

Move the jumper furthest away from the RESET switch to 1. Reset and try to program again.

If the device is not detected you may need to hold reset, click program, once it is detected release reset.

If you are unable to get the device in DFU mode for programming you may need to use STM32CubeProgrammer to erase the chip.

Alternative upload methods

See the uploading documentation on PlatformIO for alternatives.