I just ordered one of those cheap 4USD STM32F103 boards from ebay and a JTAG probe.

It’s labeled STM32FxCxT6 Board V5.02 150118

Top view of the cheap STM32F103C8T6 board labelled STM32FxCxT6 Board V5.02Β Β Β Β Β  Second view of the STM32F103C8T6 board, from the Taobao listing

As always, the price is as light as the documentation, but eventually digging the WWW you find interesting things.

Most electronic products available on Ebay, Aliexpress, DX, Banggood, … are also available from Taobao and after 15 mins search I found an ad selling the same looking board with a link to sample codes.

To me, the most interesting file in the archive is circuit diagram of the board.

The onboard LED is connected to the pin PC13.

Excerpt of the board circuit diagram showing the onboard LED wired to pin PC13

Since I just want to blink an LED, I’ll go for the fastest way and use the mbed online IDE.

  1. Add the platform NUCLEO-F103RB to your IDE.
    the C8 and RB differ as follows:
    R = 64 pins| C = 48 pins
    B = 128KB Flash| 8 = 64 KB Flash
    The memory addresses are the same.

  2. Create a new project and use the following code

    #include "mbed.h"
    
    DigitalOut led(PC_13);
    
    int main() {
        while(1) {
            led = 1;
            wait(0.5); // 500 ms
            led = 0;
            wait(0.5);
        }
    }
    
  3. Press compile and download the .bin file.

  4. Assuming you know how to install OpenOCD on your box, I like to use the following ./flash.sh script to flash the target with the J-LINK JTAG probe.
    The STM32F103C8T6 board wired to the J-Link JTAG probe used to flash it with OpenOCD

    #!/bin/sh
    
    binpath="$1"
    cfgfile="/tmp/flash_cmds.cfg"
    
    cat > "$cfgfile" <<EOF
    init
    reset init
    halt
    flash write_image erase $binpath 0x08000000
    reset run
    shutdown
    EOF
    
    openocd -f /usr/share/openocd/scripts/interface/jlink.cfg -f /usr/share/openocd/scripts/target/stm32f1x.cfg -f "$cfgfile"
    
  5. Congrats, your onboard LED should now be flashing πŸ™‚