I just ordered one of those cheap 4USD STM32F103 boards from ebay and a JTAG probe.
It’s labeled STM32FxCxT6 Board V5.02 150118
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.
Since I just want to blink an LED, I’ll go for the fastest way and use the mbed online IDE.
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.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); } }Press compile and download the .bin file.
Assuming you know how to install OpenOCD on your box, I like to use the following
./flash.shscript to flash the target with the J-LINK JTAG probe.
#!/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"Congrats, your onboard LED should now be flashing π

Β Β Β Β Β 
