ARM Development Boards
ARM Development Boards
Jedzia
ARM Development
Boards
Reference Document
for Electronic
Laboratory Work
First Edition
Jedzia
ARM Development Boards
Edited by
Jedzia
Jedzia
2020
Here goes ISBN, Author Info, publishing info
Preface to the First Edition
The algorithmic way of life is best.
Hermann Weyl
Lorem IpsumOnsequossit que eriorem elenime ndaecum re vellam sam, tem eosae porem. Ta-
tempe rferianda quam re, occum elliquati volores tiberchitiam que non rem quo occabor eiciae
culparionsed ea simust alic teniminvelit que voloreiur alignat urerate cus et dunt ea voloris exce-
rum et laboreped ent aut qui dis dipsum doluptatquis eum es nullori busdam rem quo earuptatem
dolore opturibus ulpa volorpo stotatis des ipsam, sitae nus eum sum aribear chillest illat volecus,
inctus voloreped ut vollit at es dolorec uptati nis am quis velis excerferia ni con eossusda dolup-
tiatis aut volum am nos aspelendaes ea nonsedigene landi dignatio di qui ad quis nost ius dit,
sitatur, explign atemporro vellabo reptia parions ectate ducillu ptatur ad esequia volorume pernatur
ra suntis consequatur, cones magnitin nonecuptatet lab ipsum fugitia nos modit hil mod ut aut re,
voluptaturi dolori te vel molorestiae nobitat.
Eperorum volut latur? Qui sequatiorro consecte velestrum facerferes aut laboremos mi, niet alite-
cus sam qui delest ut la as nullab ius endi conseque por aspernatem conet, omnis ad et que la
nonsequate voluptatur?
Lor secabor a quiatiu mquatetur magnatquo mi, conseque erferro quis aceaquam que et laboris ci-
tatempero volupta nis dolore eos sed eatur? Olorehenim harum vendem quunt, con parum a cum
sit vellandios volescipsunt ilitios moles et aut aspeditatia alit rerferum re illigni mendel min ped
quam lam es incieni hicimet lautem rest ommolenis molorerferio vel inum iumquia nobisti andaepe
riorepudant estotaqui ut idebis dolupta dolori diciis eaquis ra quidest, niminvelit licipiet eaquatur,
ipsandam natibus expe audaecaecto blabore moluptas vellestis et mod moluptat dolla que volor-
por alibus aturibus, nonsequi sapis etur?
Ut plia sitates cuptat por modis asinctae. Volore inte atessim agnimilis ariat labori quate sunt.
Boratio et et restiam vit offici omnis at ut lis intiatus nis dicium fuga. Net ipis sim erferissus sitatiis
exerat.
Occulpa riones molupta eume sequam que nem nonseribus dit dolupta tionsequid ut officim hit
harchitibea doluptur?
List of Software 11
The Electronic/ARM Projects Directory Guide 12
Directory Structure 12
eclipse\blinkyF103 12
BlackPill\SW4Test 12
BlackPill\BlinkyCM3 12
BlackPill\BlackPill-libopencm3-blinky-template 12
eclipse 12
ToDo: 12
-11- Jedzia
Version 1.1, created 20 August 2020 1:11 PM by Jedzia
printed 20/08/20.
2019
The Electronic/ARM Proj-
ects Directory Guide
This is a helping hand for easy finding what you want to, without getting too much confused. For details refer to the documentation (if some exists) in the
referred sub-projects.
Note: Update this document with
E:\Projects\Elektronik\ARM>pandoc "!Contents.md" -s -o doc/Contents.icml
before updating it in ARM\doc\Software-Intro.indd.
Directory Structure
Abbrevations: - StdPeriph: Is build or based on the Standard Peripherals library. The following quote from ST Website means that if it uses StdPeriph,
then it also uses CMSIS, because StdPeriph is based on that. > The STM32F0xx Standard Peripherals library is full CMSIS compliant.
eclipse\blinkyF103
Blue Pill blink. uses stm32f1-stdperiph. Contains “diag/Trace.h”, debug-trace output code usage. Current battlefield for the blink template testing, that is
not working.
BlackPill\SW4Test
System Workbench for STM32 example Project. StdPeriph based Uses J-Link.
BlackPill\BlinkyCM3
Makefile based with libopencm3. - Git-Export: E:\Projects\Elektronik\ARM\BlackPill\BlackPill-libopencm3-blinky-template.zip.
- Git initialzed template, before i added eclipse support E:\Projects\Elektronik\ARM\BlackPill\BlackPill-libopencm3-blinky-tem-
plate.rar.
BlackPill\BlackPill-libopencm3-blinky-template
Based on BlinkyCM3 (Makefile based with libopencm3) with Eclipse support. - Git initialzed template E:\Projects\Elektronik\ARM\BlackPill\
BlackPill-libopencm3-blinky-eclipse-template.rar.
eclipse
My personal setup of eclipse notes. Version 2019-03
C:\Toolchain\eclipse\eclipse-cpp-2019-03-R-win32-x86_64\
run via
@echo off
REM set PATH=C:\Toolchain\ARM\gcc-arm-none-eabi-4_8-140708\bin;C:\Toolchain\mingw-w64\x86_64-w64-mingw32-
8.3.0-crt-6.0.0-multilib\bin;C:\msys64\usr\bin;C:\Toolchain\OpenOCD\OpenOCD-20190210-0.10.0\bin;%PATH%
REM set PATH=D:\Users\Jedzia.pubsiX\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-
2014q1\bin;C:\Toolchain\mingw-w64\x86_64-w64-mingw32-8.3.0-crt-6.0.0-multilib\bin;C:\msys64\usr\bin;C:\Tool-
chain\OpenOCD\OpenOCD-20190210-0.10.0\bin;%PATH%
set PATH=C:\Toolchain\ARM\GNU MCU Eclipse\ARM Embedded GCC\8.2.1-1.4-20190214-0604\bin;C:\Toolchain\
mingw-w64\x86_64-w64-mingw32-8.3.0-crt-6.0.0-multilib\bin;C:\msys64\usr\bin;C:\Toolchain\OpenOCD\Ope-
nOCD-20190210-0.10.0\bin;%PATH%
ToDo:
-12-
This is a draft. This chapter is only relevant, when
the “Projects” repository is published.
-13-
This is a draft. This chapter is only relevant, when
the “Projects” repository is published.
-14-
This is a draft. This chapter is only relevant, when
the “Projects” repository is published.
-15-
Reference
1. Arduino IDE
Download: http://arduino.cc/en/Main/Software.
Boards Manager Package for STM32F1x series: http://dan.drown.org/stm32duino/pack-
age_STM32duino_index.json.
Prefered Installation: https://wiki.stm32duino.com/index.php?title=Installation.
Arduino STM32 files: https://github.com/rogerclarkmelbourne/Arduino_STM32/ar-
chive/master.zip.
2. ST-LINK/V2
https://www.st.com/en/development-tools/st-link-v2.html#tools-software
3. STM32duino-bootloader
https://github.com/rogerclarkmelbourne/STM32duino-bootloader
With binaries at https://github.com/rogerclarkmelbourne/STM32duino-bootloader/
tree/master/binaries.
Black Pill Bootloader: https://github.com/rogerclarkmelbourne/STM32duino-boot-
loader/blob/master/binaries/generic_boot20_pb12.bin?raw=true
Maple Mini Bootloader: https://github.com/rogerclarkmelbourne/STM32duino-boot-
loader/blob/master/binaries/maple_mini_boot20.bin?raw=true.
4. OpenBLT Bootloader
https://sourceforge.net/projects/openblt/
https://github.com/feaser/openblt
-16-
Black Pill, STM32F103 board
The Black Pill is the latest “pill” board. It is newer and less common than the Blue Pill and the Red
Pill. It is available on AliExpress, eBay and Taobao.
-17- Jedzia
Version 1.2, created 20 August 2020 1:12 PM by
Jedzia 2020
1. Black Pill Pin-Out
3V3
Board Hardware
GND
PA14
PA13
Pin Name SPI total source/-
PWM Pin sink for entire
Control I2C SWCLK 37 34 SWDIO 5V Tolerant CPU!
Analog CAN BUS not 5V Tolerant
JTCK JTMS Alternate function max ±20mA
Se r ial
Timer & Channel USB sink max 3mA per pin, ±8mA
! source 0mA recommended
PB12 LED
max 2MHz, 30pF
CK 3 T1BKIN NSS 2 SMBAI2 PB12 25 22 PB11 SDA 2 RX 3 T2C4N
CTS3 T1C1N SCK 2 PB13 26 21 PB10 SCL 2 TX 3 T2C3N
RTS3 T1C2N MISO 2 PB14 27 19 PB1 ADC9 T3C4 T1C3N
T1C3N MOSI 2 PB15 28 18 PB0 ADC8 T3C3 T1C2N
3V3
GND
MCO T1C1 CK 1 PA8 29 17 PA7 ADC7 MOSI 1 T3C2 T1C1N
T1C2 TX 1 PA9 30 16 PA6 ADC6 MISO 1 T3C1 T1BKIN
-18-
44
T1C3 RX 1 PA10 31 15 PA5 ADC5 SCK 1
CANRX T1C4 CTS1 USB- PA11 32 14 PA4 ADC4 NSS 1 CK 2
CANTX T1ETR RTS1 USB+ PA12 33 13 PA3 ADC3 RX 2 T2C4
PB2 20
TRACE T2C1E NSS 1 JTDI PA15 38 12 PA2 ADC2 TX 2 T2C3
T2C2 SCK 1 JTDO PB3 39 11 PA1 ADC1 RTS2 T2C2
SWO T3C1 MISO 1 JTRST PB4 40 10 PA0 ADC0 CTS2 T2C1E WKUP
T2C2 MOSI 1 SMBAI1 PB5 41 7 NRST Reset Button
TX 1 T4C1 SCL 1 PB6 42 ! 2 PC13 TAMPER-RTC
BOOT1
RX 1 T4C2 SDA 1 PB7 43 BOOT0 46 PB9 SDA 1 T4C4 CANTX
Allways double check! 3V3 45 PB8 SCL 1 T4C3 CANRX
GND GND
Your layout may differ.
Possible +5V VCC instead
Boot Mode
B0- B0+ B0- B0+ B0- B0+
Main Flash System
Normal Serial SRAM
Figure 1. Black_Pill_Pinout-adv.ai B1- B1+ B1- B1+ B1- B1+
Operation Programming
2. Black Pill Schematic
VCC3.3 U1
PA0 10 18 PB0
PA0-WKUP PB0
PA1 11 19 PB1
C1 C2 C3 C4 PA1 PB1 R1
PA2 12 20 BOOT1
104 1UF 104 104 PA2 PB2/BOOT1
PA3 13 39 PB3 10K
PA3 PB3/JTDO
PA4 14 40 PB4
PA4 PB4/JNTRST
PA5 15 41 PB5
GND PA5 PB5
PA6 16 42 PB6
PA6 PB6 VCC3.3 JP1 VCC3.3
PA7 17 43 PB7
PA7 PB7
1 2
PA8 29 45 PB8 BOOT0 BOOT1
PA8 PB8 3 4
PA9 30 46 PB9 5 6
PA9 PB9
Y1 PA10 31 21 PB10
PA10 PB10 BOOT
XTALA XTALB JP2 VCC3.3 USBDM 32 22 PB11
PA11 PB11 GND GND
USBDP 33 25 PB12
VCC3.3 4 PA12 PB12
8M SWDIO 34 26 PB13
3 PA13/JTMS/SWDIO PB13
R2 SWCLK 37 27 PB14
2 PA14/JTCK/SWCLK PB14
10M PA15 38 28 PB15
C5 C6 1 PA15/JTDI PB15 VCC3.3 VCC3.3
22PF 22PF R3
SWD XTALA 5 2 PC13
10K OSC_IN/PD0 PC13-TAMPER-RTC
GND XTALB 6 3 XTALC D1 D2
OSC_OUT/PD1 PC14-OSC32_IN
PC15-OSC32_OUT
4 XTALD 电源 测试
GND NRST R4 10K
BOOT0 44
Y2 BOOT0 R5 R6
XTALC XTALD 1K 1K
NRST 7
S1 NRST
32.768K C7 SW-PB
104 1
VBAT
PB12
C8 C9 24 23 GND
22PF 22PF VDD_1 VSS_1
36 35
VDD_2 VSS_2
48 47
VDD_3 VSS_3
-19-
GND 9 8
GND VDDA VSSA
VCC3.3 STM32F103C8T6
GND
JP3 JP4
PB12 PB11
17 1
PB13 PB10
16 2 VCCIN
PB14 PB1 VCC5V
15 3 U2 microusb
PB15 PB0 U3 VCC3.3
14 4
PA8 PA7 1 5
13 5 VCC VOUT
PA9 PA6 C10
12 6
GND
ID
U+
U-
VCC
10 8
PA12 PA3 GND VCCIN 3 4
9 9 VCC5V EN BP
PA15 PA2
8 10 VCC3.3
PB3 PA1 R7 RT9193 C13 GND
7 11
USBDP 3
USBDM2
Figure 2. Black_Pill_Schematic.pdf
Comment Description Designator Footprint LibRef Quantity
[NoValue], [NoValue],
104 [NoValue], [NoValue], C1, C3, C4, C7, C11 0603C CAP 5
Capacitor
1UF C2 0603C CAP 1
22PF SMD-CAP C5, C6, C8, C9 0603C CAP-0.1UF 4
105 Capacitor C10, C12 0603C CAP 2
22nf Capacitor C13 0603C CAP 1
电源 D1 0603D LED 1
测试 D2 0603D LED 1
ZENER3 Zener Diode D3 0805D ZENER3 1
BOOT JP1 HDR2X3 HEADER 3X2 1
SWD 4 Pin Header JP2 HDR1X4 4 HEADER 1
HEADER 17 JP3, JP4 HEADER 17 2
Res2 Resistor R1, R4 0603B Res2 2
10M R2 0603B RES1 1
10K R3 0603B RES1 1
1K Resistor R5, R6 0603B Res1 2
1.5K R7 0603B RES1 1
SW-PB S1 贴片按键 SW-PB 1
STM32 ARM-based 32-bit
MCU with 64 Kbytes Flash,
STM32F103C8T6 U1 LQFP48_N STM32F103C8T6 1
48-pin LQFP, Industrial
Temperature
microusb U2 MICRO-USB microusb 1
RT9193 U3 SOT23-5 RT9193 1
8M 晶振 Y1 49SMD XT 1
32.768K 晶振 Y2 32.768K晶振 XT 1
3. Getting Started
via https://wiki.stm32duino.com/index.php?title=Black_Pill using Arduino IDE. For installing and setup
refer to [1. Arduino IDE]. Note: The Boards-Manager method is deprecated and not supported in forum.
Use the dedicated download package if you want support for other devices.
• Buy a Black Pill
• Burn the bootloader
• Under ‘Tools→Board’ select “Generic STM32F103 series”
• Under ‘Tools→Upload method’ select “STM32duino bootloader”
• Select the correct COM port
• Open up the blink sketch, change the pin number to PB12
• Hit upload
It is also possible to upload sketches via UART and JTAG, though this will overwrite the bootloader.
3.3. Similarities
• STM32F103C8T6 32 bit ARM M3 microcontroller
• 4-pin ST-Link header
• Micro-USB
• No USB reset circuitry (reset over USB is still possible, though less reliable than the Maple Mini)
-20-
3.4. Differences
• Different pinout
• User LED on PB12 vs PC13 on a Blue pill
• Black pill does not have a VIN pin, it can only be powered from USB or a 3.3 V source.
-21-
4.2. Flashing the bootloader onto the Black Pill via ST-Link
Interface
USB DM
USB DP
MOSI 2
MISO 2
SCK 2
Obtain the software from [2. ST-LINK/V2], install driver and STM32 ST-LINK utility.
SS 2
RX 1
TX 1
We need 3 wires for basic ST-Link functionality, the actual colours of the wires are not important.
• Programmer -> Target
PA15
PA12
PA10
PA11
PA9
PA8
• Ground (orange) -> GND
5V Tolerant
PWM
Serial
Analogue
Digital
• SWDIO (yellow) -> PA13 - SWDIO
PB15
PB14
PB13
PB12
PA15
PA12
PA10
PA11
GND
PB7
PB6
PB5
PB4
PB3
SWCLK
Jumper
GND 3V3
PA14 SWCLK open for
PA13
3V3 GND
SWDIO
External
SWD
SWDIO
Reset
N.C.
WARNING: When developing, and powering the STM32
Reset
PC13
PB10
PB11
GND
PB8
PB9
PB0
PB1
PA0
PA1
PA2
PA3
PA4
PA5
PA6
PA7
SDA 2
SCL 2
RX 2
SS 1
TX 2
To flash the Bootloader you can use the GUI-Utility, File→Open File(CTRL-O) generic_boot20_
pb12.bin and transfer it to the device with Target→Program & Verify(CTRL-P).
Or use the command-line interface tool:
ST-LINK_CLI.exe -c SWD -P generic_boot20_pb12.bin 0x8000000 -Rst -Run
under Linux:
./stlink/st-flash write generic_boot20_pb12.bin 0x8000000
./upload-reset
4.3. Flashing the bootloader onto the Black Pill via USB to Serial
converter using UART1
Windows
The Black Pill does not come with any USB bootloader. This process should be roughly the same for all
F103 boards.
1. Download the correct bootloader binary, in this case generic_boot20_pb12.bin [https://github.
com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/binaries/generic_boot20_pb12.
bin?raw=true]
2. Set the ‘boot 0’ pin/jumper high, and ‘boot 1’ low
• B0+ to center pin
• B1- to center pin
-22-
PA14
PA13
GND
3V3
3. Connect the board to the PC using a USB to serial converter:
SWCLK 37 34 SWDIO
Boot Mode JTCK JTMS
VCCIO
B0+ S e r i a l
GND
DCD
DSR
RXD
DTR
RTS
TXD
B0- B0+ B0- B0- B0+
Main Flash System
RI
! SRAM
I/O
Output
Input
Control
Chip Pin
Normal Serial PB12 LED
Set System
B1- B1+
to 10
B1- B1+ B1- B1+
7..
9
6
5
4
3
2
1
Operation Programming PB12 25 22 PB11
PB13 26 21 PB10
3.3 V! PB14 27 19 PB1
GND
5V
3V3
USBDM USBDP
PB15 28 18 PB0
7.. GND PA8 29 17 PA7
20 3V3 11 CTS PA9 30 16 PA6
16 4 VCCIO PA10 31 15 PA5
BOOT1 PB2 20
44
15 1 TXD PA11 32 14 PA4
5V
PB3 39 11 PA1
check thiŝ
BOOT0
PB4 40 10 PA0
Output
Select
PB5 41 7 NRST
PB6 42 ! 2 PC13
14 PWREN CBUS 3
13 TXDEN CBUS 2
12 Sleep CBUS 4
17
20
22 RXLED CBUS 1
23 TXLED CBUS 0
7..
11
USB
Board Hardware
PA14
PA13
GND GND
with an FTD232RL Adapter
GND
GND
3V3
CTS
3V3
5V
SWCLK 37 34 SWDIO
Boot Mode JTCK JTMS
B0- B0+ B0- B0+ B0- B0+
Main Flash System
Normal Serial PB12 LED
SRAM
B1- B1+ B1- B1+ B1- B1+
Operation Programming PB12 25 22 PB11
PB13 26 21 PB10
PB14 27 19 PB1
GND
3V3
PB15 28 18 PB0
5V
3V3
USBD-
6 PA8 29 17 PA7
VDD PA9 30 16 PA6
7 26 TXD PA10 31 15 PA5
BOOT1 PB2 20
44
5 25 RXD PA11 32 14 PA4
4 3 GND PA12 33 13 PA3
USBD+
3 7 5V PA15 38 12 PA2
PB3 39 11 PA1
GND
BOOT0
PB4 40 10 PA0
CP2102 USB to TTL Converter PB5
PB6
41
42 !
7
2
NRST
PC13
Programming the Black Pill PB7
3V3
43 46
45
PB9
PB8
GND GND
with an CP2102 Adapter
• RX to PA9
• TX to PA10
• GND to G on the ST-Link connector
• 3.3V to V3 on the ST-Link connector
• Ensure the USB to serial converter is in 3.3 V mode
4. Reset the board, the user LED should now be off
5. Download and install Flash Loader Demonstrator from here: [http://www.st.com/content/st_com/en/
products/development-tools/software-development-tools/stm32-software-development-tools/stm32-
programmers/flasher-stm32.html]
-23-
6. Use Flash Loader Demonstrator to flash the bootloader:
• Select the correct COM port, yours will be different from the screenshots
7. For normal use, set both boot pins low
• B0- to center, pin B1 stays the same, B1- to center.
Linux
Steps 1-4 and 7 are the same for both Windows and Linux
For steps 5-6, use the command from the Maple Mini Linux procedure section 4.4 on page 25, chang-
ing the paths and filenames as necessary.
-24-
cd ~/.arduino15/packages/stm32duino/tools/stm32tools/1.0.9/linux/stm32flash
./stm32flash -w ~/Downloads/generic_boot20_pb12.bin -v -g 0x0 /dev/ttyUSB0
The console should show that the board is detected and that the bootloader was written successfully.
stm32flash Arduino_STM32_0.9
http://github.com/rogerclarkmelbourne/arduino_stm32
Now connect your USB cable to the board and run dmesg. You should see the Maple pid/vid:
-25-
[Sat Oct 22 12:20:45 2016] usb 3-3: New USB device found, idVendor=1eaf, idProduct=0003
[Sat Oct 22 12:20:45 2016] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[Sat Oct 22 12:20:45 2016] usb 3-3: Product: Maple 003
[Sat Oct 22 12:20:45 2016] usb 3-3: Manufacturer: LeafLabs
[Sat Oct 22 12:20:45 2016] usb 3-3: SerialNumber: LLM 003
The above procedures works for any STM32 board. You will need to download the correct bootloader bi-
nary to match your board and change the jumpers to Boot0=1 and Boot1=0 for the flash procedure. Once
the flash procedure is complete, set both Boot jumpers to 0.
-26-
5. Notes
-27-
Reference
1. Arduino IDE
Download: http://arduino.cc/en/Main/Software.
Boards Manager Package for STM32F1x series: http://dan.drown.org/stm32duino/pack-
age_STM32duino_index.json.
Prefered Installation: https://wiki.stm32duino.com/index.php?title=Installation.
Arduino STM32 files: https://github.com/rogerclarkmelbourne/Arduino_STM32/ar-
chive/master.zip.
2. ST-LINK/V2
https://www.st.com/en/development-tools/st-link-v2.html#tools-software
3. STM32duino-bootloader
https://github.com/rogerclarkmelbourne/STM32duino-bootloader
With binaries at https://github.com/rogerclarkmelbourne/STM32duino-bootloader/
tree/master/binaries.
Black Pill Bootloader: https://github.com/rogerclarkmelbourne/STM32duino-boot-
loader/blob/master/binaries/generic_boot20_pb12.bin?raw=true
Maple Mini Bootloader: https://github.com/rogerclarkmelbourne/STM32duino-boot-
loader/blob/master/binaries/maple_mini_boot20.bin?raw=true.
4. OpenBLT Bootloader
https://sourceforge.net/projects/openblt/
https://github.com/feaser/openblt
-28-