VccGND BluePill

The VccGND Blue Pill board is available in different versions, each with a specific microcontroller from different silicon vendors in standard package size LQFP48. It is a clone of the original hobbyist Blue Pill board solderd with either STM32F0 [24] or STM32F1 [39] microcontrollers. Partially, Zephyr upstream boards also exist. See the Links / References column below.

Architecture

Vendor

MCU Series / Line / Type

Clock

Flash

SRAM

Status

Links / References

Arm Cortex-M3

STMicroelectronics [23]

STM32F1 [39]

STM32F103 [42]

STM32F103CB [45]

72㎒

128㎅

20㎅

 

VccGND Studio BluePill-STM32F1 [2]

STM32-base: STM32F1 BluePill [4]

STM32 Minimum Development Board

STM32F103C8 [43]

72㎒

64㎅

20㎅

Arm Cortex-M0

STM32F0 [24]

STM32F0x2 [34]

STM32F072CB [37]

48㎒

128㎅

16㎅

⚠️

VccGND Studio BluePill-STM32F0 [5]

STM32-base: STM32F0 BluePill [6]

STM32F072C8 [35]

48㎒

64㎅

16㎅

STM32F0x1 [30]

STM32F051C8 [32]

48㎒

64㎅

8㎅

STM32F0x0 [26]

STM32F030C8 [28]

48㎒

64㎅

8㎅

:
⚠️ :
:
counterfeit

-- west flash: rebuilding
-- west flash: using runner pyocd
-- runners.pyocd: Flashing file: build/vccgnd_bluepill/zephyr/zephyr.hex
0001860 E Not a genuine ST Device! Abort connection. [functions]
0001905 I Loading build/vccgnd_bluepill/zephyr/zephyr.hex at 0x08000000 [load_cmd]
[==================================================] 100%
0004398 I Erased 32768 bytes (32 sectors), programmed 32768 bytes (32 pages), skipped 0 bytes (0 pages) at 12.96 kB/s [loader]

Supported Boards

Hardware

The VccGND Studio BluePill-STM32F1 [2] is available with an STM32F103 in two different configurations featuring different sizes of on-chip flash memory. It follows the general BluePill connector concept with two opposing 20-pin headers.

Features and Resources

Printed Circuit Board

5V/480㎃ 3.3V/300㎃ 3.3V(OUT)

72㎒ 64/128㎆ 16/20㎅ RST GREEN USB-B SWD

5 3 10 2 1 1 1

  • Single core Arm Cortex-M3 processor running up to 72㎒

  • 16/20㎅ on-chip SRAM

  • 64/128㎆ on-chip flash with XIP capabilities

  • USB 1.1 controller (device)

  • CAN 2.0 A/B controller (SOF, 14 filter)

  • On-board USB-B micro connector

  • On-board 3.3V LDO regulator with 300㎃

  • On-board RESET button

  • On-board BOOT0 jumper

  • On-board BOOT1 jumper

  • On-board LED

  • 32 GPIO pins via edge pinout (5 free)

  • 15 PWM channels (3 free)

  • 10 ADC analog inputs

  • 1 UART peripherals

  • 2 I2C controllers

  • 1 SPI controllers

  • 1 Watchdog timer peripheral

  • 1 Temperature sensor on-chip

Design Data

Remarks

  • Warning: The +5V pins on the board headers are directly connected to the +5V pin of the USB connector. There is no protection in place. Do not power this board through USB and an external power supply at the same time!

  • Warning: This board may have a wrong value of resistor (R10) on the USB D+ pin. Instead of a 1.5kΩ it has either a 10kΩ or 4.7kΩ resistor. This can be solved by replacing the resistor with the right value.

  • Warning: The board is also available with type STM32F072. The Zephyr board configuration is then a mixture of the STM32F1 schematic but a STM32F0 software definition.

VccGND BluePill STM32F103Cx/F072Cx

Positions

VccGND BluePill STM32F103Cx/F072Cx details
  1. USB Type-B connector
    Supports USB1.1 slave devices
  2. XC6219B332MR (LB2K)
    300㎃ low dropout, low noise, ultra-fast LDO
    also possible: TX6211B (DE=A1D), or RT9193-33
  3. STM32F103Cx or STM32F072Cx
    one of the supported by STMicroelectronics
  1. USER LED monochrome
    user LED for diagnostic (not power indicator)
  2. BOOT0/1 jumper
    select correct when resetting to enter download mode
  3. RESET button

  4. SWD Port
    for flashing and debugging (with 3V3 power supply)

Data Sheets

Pinouts

The peripherals of the different populated microcontrollers can be routed to various pins on the boards edge connectors. The configuration of these routes can be modified through DTS. Please refer to the datasheets to see the possible routings for each peripheral. The default assignment is defined below in a single table.

Pin Mapping

Pinout

on-board:

1 SIGNAL

on-header:

5 3 10 2 1 1 1

Default Zephyr Peripheral Mapping

 

  • 1 SPI2_NSS : PB12
  • 2 SPI2_SCK : PB13
  • 3 SPI2_MISO : PB14
  • 4 SPI2_MOSI : PB15
  • 5 MCO : PA8
    nc T1C1 alternative
  • 6 USART1_TXD : PA9
  • 7 USART1_RXD : PA10
  • 8 USB_DM : PA11
  • 9 USB_DP : PA12
  • 10 GPIO_EXTI15/SPI1 : PA15
  • 11 GPIO_EXTI3/SPI1 : PB3
  • 12 GPIO_EXTI4/SPI1 : PB4
    nc T3C1 alternative
  • 13 GPIO_EXTI5/SPI1 : PB5
    nc T2C2 alternative
  • 14 I2C1_SCL : PB6
  • 15 I2C1_SDA : PB7
  • 16 CAN_RX : PB8
  • 17 CAN_TX : PB9
  • 18 5V
  • 19 GND
  • 20 3V3
  • 21 VBAT
  • 22 GPIO_EXTI13/RTC : PC13
  • 23 GPIO_EXTI14/RTC : PC14
    nc on-board OSC32_IN for RTC
  • 24 GPIO_EXTI15/RTC : PC15
    nc on-board OSC32_OUT for RTC
  • 25 ADC1_IN1 : PA0
    nc on-chip WKUP to exit sleep mode
  • 26 ADC1_IN2 : PA1
  • 27 ADC1_IN3 : PA2
  • 28 ADC1_IN4 : PA3
  • 29 ADC1_IN5 : PA4
  • 30 ADC1_IN6 : PA5
  • 31 ADC1_IN7 : PA6
  • 32 ADC1_IN8 : PA7
  • 33 ADC1_IN9 : PB0
  • 34 ADC1_IN10 : PB1
  • 35 I2C2_SCL : PB10
    nc USART3_TXD alternative
  • 36 I2C2_SDA : PB11
    nc USART3_RXD alternative
  • 37 NRST
  • 38 3V3
  • 39 GND
  • 40 5V

On-Board Mapping for SWD

 

  • nc SYS_SWDIO : PA13
  • nc
  • nc SYS_SWCLK : PA14
  • nc
  • nc 3V3
  • nc GND

On-Board Mapping for USER

 

  • nc GPIO_EXTI2 : PB2
    nc on-chip BOOT1 @ 10kΩ pull-down

Devicetree compatible

VccGND BluePill STM32F103Cx/F072Cx edge pinout

Supported Features

The VccGND BluePill board configuration supports the following Zephyr hardware features:

Hardware Features Supported by Zephyr

Peripheral

Kconfig option

Devicetree compatible

Zephyr API

PINCTRL

CONFIG_PINCTRL

st,stm32f1-pinctrl

Pin Control API

GPIO

CONFIG_GPIO

st,stm32-gpio

General-Purpose Input/Output (GPIO)

UART

CONFIG_SERIAL

Universal Asynchronous Receiver-Transmitter (UART)

UDC (USB Device Controller)

CONFIG_USB_DEVICE_STACK

USB device support APIs

CAN (L1: PMA / PCS, L2: DLL)

CONFIG_CAN

st,stm32-bxcan

Controller Area Network (CAN) Bus Protocols

I2C

CONFIG_I2C

st,stm32-i2c-v1

Inter-Integrated Circuit (I2C) Bus

SPI

CONFIG_SPI

Serial Peripheral Interface (SPI) Bus

PWM

CONFIG_PWM

Pulse Width Modulation (PWM)

ADC

CONFIG_ADC

Analog-to-Digital Converter (ADC)

RTC

CONFIG_RTC

st,stm32-rtc

Real-Time Clock (RTC) as Counter

Timer (Counter)

CONFIG_COUNTER

Counter

Watchdog Timer (WDT)

CONFIG_WATCHDOG

Watchdog

Flash

CONFIG_FLASH

Flash and Flash map

DMA

CONFIG_DMA

st,stm32-dma-v2bis

Direct Memory Access (DMA)

HWINFO

CONFIG_HWINFO

N/A

Hardware Information

RESET

CONFIG_RESET

Reset Controller

CLOCK

CONFIG_CLOCK_CONTROL

Clock Control

NVIC

N/A

Nested Vector Interrupts Controller

SYSTICK

N/A

arm,armv7m-systick

Other hardware features are not currently supported by Zephyr. The default configuration can be found in the different Kconfig files:

Board Configurations

The VccGND BluePill boards can be configured for the following different use cases.

west build -b vccgnd_bluepill_stm32f103cb

Use the serial port USART1 on edge header as Zephyr console and for the shell.

west build -b vccgnd_bluepill_stm32f103cb -S usb-console

Use the native USB device port with CDC-ACM as Zephyr console and for the shell.

System and Real-Time Clock

The STM32 system clock (SYSCLK) on the VccGND BluePill boards can be driven by an internal or external oscillator, as well as the main PLL clock. By default the system clock is provided by the PLL clock with 72㎒ on STM32F1 or 48㎒ on STM32F0, which is driven by the external (on-board) 25㎒ crystal connected to the high-speed clock input.

The STM32 real-time clock (RTC) on the VccGND BluePill boards can be driven by an internal or external oscillator. By default, the real-time clock will be driven by the external (on-board) 32.768㎑ crystal connected to the low-speed clock input.

User LED

The VccGND BluePill boards feature one LED for user purposes at GPIO port C line 13 (PC13). The LED is low active.

ADC/TS Ports

The VccGND BluePill boards features an 12-bit ADC with 10 external usable channels and, when supported, some additional channels connected internaly to the on-chip temperature sensor (TS), the internal provided voltage reference source (VREF) and the external battery voltage (VBAT) when supported. The ADC channels 0-9 are available on the edge connectors.

SPI Port

The VccGND BluePill boards features one five wire SPI bus over SPI2 also available on the edge connectors and the standard pins. SPI1 is not available in any default setup.

I2C Port

The VccGND BluePill boards features two I2C buses over at I2C1 and I2C2 also available on the edge connectors and the standard pins. I2C1 is the BluePill standard bus.

CAN Port

The VccGND BluePill boards with STM32F1 and STM32F072 features one CAN controller, but without any CAN transceiver on board. The bus timing is defined by the DTS and is preset to 1000 kBit/s. The calculation was verified with the help of the CAN Bit Time Calculation Sheet [1] and can also assume smaller bit rates according to the following table. Note that the value of Prescaler, Seg 1 and Seg 2 will be calculated on demand by the Zephyr CAN Controller API together with the driver.

CAN bus timing calculation for STM32F1 @ 36㎒

Bit Rate

Sample Point at

Prescaler

Seg 1 (prop-seg + phase-seg1)

Seg 2 (phase-seg2)

1000 kBit/s

88.9 %

2

15

2

800 kBit/s

88.9 %

5

7

1

500 kBit/s

88.9 %

4

15

2

250 kBit/s

88.9 %

8

15

2

125 kBit/s

88.9 %

16

15

2

100 kBit/s

88.9 %

20

15

2

50 kBit/s

88.9 %

40

15

2

20 kBit/s

88.9 %

100

15

2

10 kBit/s

88.9 %

200

15

2

Serial Port

The VccGND BluePill boards feature one two wire UART (RxD/TxD) at USART1 and the standard pins (PA9/PA10) to be compatible with the STMicro on-chip bootloader for firmware downloads over UART. The Zephyr console output is assigned to this USART with the default settings of 115200/8N1 without any flow control (no XON/XOFF, no RTS/CTS).

USB Device Port

The VccGND BluePill boards with STM32F1 and STM32F072 features one (native) USB full-speed device port that can be used to communicate with a host PC. See the USB device support sample applications for more, such as the USB CDC-ACM sample which sets up a virtual serial port that echos characters back to the host PC. This boards provide the Zephyr console per default on the USB port as CDC ACM:

USB device idVendor=0483, idProduct=5740, bcdDevice= 4.02
USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: BluePill STM32F103 (CDC ACM)
Manufacturer: VccGND (STMicroelectronics)
SerialNumber: 93F49F68D18508F0

Programming and Debugging

Applications for the VccGND BluePill board configuration can be built and flashed in the usual Zephyr way (see Building an Application and Run an Application for more details).

Flashing

The VccGND BluePill board needs an debug tool adapter, e.g. ST-LINK/V2, SEGGER JLink, Arm CMSIS-DAP or similar.

Flashing an application

Here is an example for the Hello World application.

Run a serial host program to connect with your VccGND BluePill board:

user@host:~$ screen /dev/ttyUSBx 115200,cs8,parenb,-parodd,-cstopb,-crtscts

Build and flash the application:

west build -b vccgnd_bluepill_stm32f103c8 -p -d build/vccgnd_bluepill zephyr/samples/hello_world
west flash -r pyocd -d build/vccgnd_bluepill

You should see the following message on the console:

*** Booting Zephyr OS build v4.2.2 ***
Hello World! vccgnd_bluepill_stm32f103c8

Debugging

The SWD interface can also be used to debug the board. To achieve this, you can either use SEGGER JLink, OpenOCD or PyOCD.

You can debug an application in the usual way. Here is an example for the Hello World application:

west build -b vccgnd_bluepill_stm32f103c8 -p -d build/vccgnd_bluepill zephyr/samples/hello_world
west debug -r pyocd -d build/vccgnd_bluepill

Tests and Examples

LED Blinky with USB-CDC/ACM Console

west build -b vccgnd_bluepill_stm32f103cb -p -S usb-console -d build/vccgnd_bluepill zephyr/samples/basic/blinky
west flash -r pyocd -d build/vccgnd_bluepill

Hello Shell

west build -b vccgnd_bluepill_stm32f103cb -p -d build/vccgnd_bluepill bridle/samples/helloshell -- \
-DEXTRA_CONF_FILE="prj-hwstartup.conf" -DCONFIG_STM32_ENABLE_DEBUG_SLEEP_STOP=y
west flash -r pyocd -d build/vccgnd_bluepill

References