Quantcast
Channel: 懒得折腾
Viewing all articles
Browse latest Browse all 764

Blink on stm32f103c8t6 Using PlatformIO (Mac)

$
0
0
    1. Install stlink.

      brew install stlink

    2. check stlink is installed.
    3. set up connection and jump.
    4. use ST Nucleo F103RB to init the board.
    5. platfromio.ini
      [env:stm32f103c8t6]
      platform = ststm32
      framework = mbed
      board = nucleo_f103rb
      upload_protocol = stlink
    6. blink code
    7. http://www.nutdiy.com/2016/05/blink-on-stm32f103c8t6-using-platformio.html
    8. It is also possible to use Arduino. The platfromio.ini will be
      [env:genericSTM32F103R8]
      platform = ststm32
      board = genericSTM32F103C8
      framework = arduino
      upload_protocol = 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



Viewing all articles
Browse latest Browse all 764

Trending Articles