-
- Install stlink.
brew install stlink
- check stlink is installed.
- set up connection and jump.
- use ST Nucleo F103RB to init the board.
-
platfromio.ini[env:stm32f103c8t6]platform = ststm32framework = mbedboard = nucleo_f103rbupload_protocol = stlink
- blink code
- http://www.nutdiy.com/2016/05/blink-on-stm32f103c8t6-using-platformio.html
- It is also possible to use Arduino. The platfromio.ini will be
[env:genericSTM32F103R8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
upload_protocol = stlink
- Install stlink.
9. Connect the blue pill with stlink
STLink pin BluePill pin
GND (3 or 4) GND
3.3V (7 or 8)3.3
SWDIO (2) DIO
SWCLK(6) DCLK
The mode in which STM32 starts is determined by pins BOOT0 and BOOT1 :
BOOT1 | BOOT0 | Boot mode |
X | 0 | User Flash memory |
0 | 1 | System memory (bootloader) |
1 | 1 | Embedded SRAM |
To get USB Serial working, I did as described in Hardware installation paragraph here and soldered a 1.5k resistor between 3.3V and PA12, while also desoldering R10 from PCB.
https://shortn0tes.blogspot.ca/2017/06/how-to-use-platformio-to-develop-for.html