## Arduino IDE installation

http://dan.drown.org/stm32duino/package_STM32duino_index.json

## Flash the STM32

STM32F103C8T6

Pinout https://idyl.io/wp-content/uploads/2018/07/stm32f103-pinout-diagram.png

spec https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill

bootloader https://github.com/stm32duino/Arduino_Core_STM32

instructions

https://freeelectron.ro/installing-st-link-v2-to-flash-stm32-targets-on-linux/ https://www.onetransistor.eu/2017/11/stm32-bluepill-arduino-ide.html https://circuitdigest.com/microcontroller-projects/getting-started-with-stm32-blue-pill-development-board-stm32f103c8-using-arduino-ide

https://github.com/stlink-org/stlink brew install stlink

BOOT0 to 1

``` $ st-info –probe Found 1 stlink programmers

version:    V2J37S7
serial:     49FF6C064883545336561087
flash:      131072 (pagesize: 1024)
sram:       20480
chipid:     0x0410
descr:      F1xx Medium-density

```

``` $ st-flash write generic_boot20_pc13.bin 0x8000000 st-flash 1.7.0 2021-05-13T16:39:02 INFO common.c: F1xx Medium-density: 20 KiB SRAM, 128 KiB flash in at least 1 KiB pages. file generic_boot20_pc13.bin md5 checksum: f6d7639c776ddc06d62a1b612ef7876, stlink checksum: 0x00192077 2021-05-13T16:39:02 INFO common.c: Attempting to write 22268 (0x56fc) bytes to stm32 address: 134217728 (0x8000000) 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08000000 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08000400 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08000800 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08000c00 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08001000 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08001400 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08001800 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08001c00 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08002000 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08002400 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08002800 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08002c00 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08003000 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08003400 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08003800 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08003c00 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08004000 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08004400 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08004800 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08004c00 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08005000 erased 2021-05-13T16:39:02 INFO common.c: Flash page at addr: 0x08005400 erased 2021-05-13T16:39:02 INFO common.c: Finished erasing 22 pages of 1024 (0x400) bytes 2021-05-13T16:39:02 INFO common.c: Starting Flash write for VL/F0/F3/F1_XL 2021-05-13T16:39:02 INFO flash_loader.c: Successfully loaded flash loader in sram 2021-05-13T16:39:02 INFO flash_loader.c: Clear DFSR 22/ 22 pages written 2021-05-13T16:39:03 INFO common.c: Starting verification of write complete 2021-05-13T16:39:03 INFO common.c: Flash written and verified! jolly good! ```

BOOT0 to 0

``` screen /dev/cu.usbmodem14401

Congratulations, you have installed the STM32duino bootloader See https://github.com/rogerclarkmelbourne/STM32duino-bootloader

For more information about Arduino on STM32 See https://www.stm32duino.com ```