WeAct BluePill+

The WeAct Blue Pill Plus 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 [54] or STM32F1 [55] 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-M4

GigaDevice [34]

GD32F30x [51]

GD32F303 [52]

GD32F303CC [53]

120㎒

256㎅

48㎅

WeAct Studio BluePill-Plus [10]

STM32-base: BluePill-Plus [13]

Arm Cortex-M3

STMicroelectronics [36]

STM32F1 [55]

STM32F103 [58]

STM32F103CB [61]

72㎒

128㎅

20㎅

STM32F103C8 [59]

72㎒

64㎅

20㎅

Geehy [35]

APM32 [38]

APM32F103 [39]

APM32F103CB [39]

96㎒

128㎅

20㎅

WeAct Studio BluePill-Plus-APM32 [14]

APM32F103C8 [39]

96㎒

64㎅

20㎅

GigaDevice [34]

GD32F10x [47]

GD32F103 [48]

GD32F103CB [50]

108㎒

128㎅

20㎅

WeAct Studio BluePill-Plus-GD32 [17]

GD32F103C8 [49]

108㎒

64㎅

20㎅

WinChipHead [37]

CH32F [40]

CH32F103 [41]

CH32F103C8 [41]

72㎒

64㎅

20㎅

WeAct Studio BluePill-Plus-CH32 [15]

BluePill Plus CH32V203

CH32F103C6 [41]

72㎒

32㎅

10㎅

RISC-V QingKe V3A

CH32V [42]

CH32V103 [43]

CH32V103C8 [43]

80㎒

64㎅

20㎅

CH32V103C6 [43]

80㎒

32㎅

10㎅

RISC-V QingKe V4B

CH32V [42]

CH32V203 [45]

CH32V203C8 [45]

144㎒

64㎅

20㎅

⚠️

CH32V203C6 [45]

144㎒

32㎅

10㎅

:
⚠️ :
:

Supported Boards

Hardware

The WeAct Studio BluePill-Plus [10] 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. The underlying schematic diagram also provides an additional SPI flash (unpopulated). This can be mounted on the bottom of the board at position U3 as an SOIC8 package. It is connected via the first SPI bus, but through pins PA4 to PA7, and thus conflicts with ADC channels 4 to 7, which are located on the same pins as on the BluePill header.

Features and Resources

Printed Circuit Board

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

72㎒ 64/128㎆ 20㎅ RST BOOT USER BLUE USB-C SWD

5 3 10 2 1 1 1

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

  • 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-C connector

  • On-board 3.3V LDO regulator with 300㎃

  • On-board RESET button

  • On-board BOOT0 button

  • On-board USER button

  • On-board LED

  • 32 GPIO pins via edge pinout (6 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 via a protective diode. With schematic V1.1, this can be bypassed by a solder bridge (SB1) provided on the bottom directly below the USB-C connector. In this case, do not power this board through USB and an external power supply at the same time!

  • Warning: With schematic V1.1, the series resistor of the user LED (R1) was increased from 1.0kΩ to 1.5kΩ. The power consumption and thus the brightness of the user LED is now slightly lower.

  • Warning: The optional SPI flash (U3) will use the same pins PA4 to PA7 as the BluePill header for ADC channels 4 to 7.

WeAct BluePill+ STM32F103Cx

Positions

WeAct BluePill+ STM32F103Cx details
  1. USB Type-C connector
    Supports USB1.1 slave devices
  2. ME6231C33 (VCWK)
    300㎃ low dropout, low noise LDO
    also possible: ME6209A33, ME6216A33, or LN1132P332M
  3. STM32F103Cx
    one of the supported by STMicroelectronics
  4. USER LED monochrome
    user LED for diagnostic (not power indicator)
  1. USER button
  2. BOOT0 button
    press it when resetting to enter download mode
  3. RESET button

  4. SWD Port
    for flashing and debugging (with 3V3 power supply)
  5. On-board SPI flash memory (unpopulated)
    4㎆ NOR-Flash W25Q32JV
    8㎆ NOR-Flash W25Q64JV
    16㎆ NOR-Flash W25Q128JV

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 BUTTON 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 and USER

 

  • nc GPIO_EXTI2 : PB2
    nc on-chip BOOT1 @ 10kΩ pull-down
  • nc GPIO_EXTI0 WKUP : PA0
    nc competes with ADC1_IN1

On-Board Routings for SPI Flash (unpopulated)

 

  • nc SPI1_NSS : PA4
    nc competes with ADC1_IN5
  • nc SPI1_SCK : PA5
    nc competes with ADC1_IN6
  • nc
  • nc
  • nc SPI1_MISO : PA6
    nc competes with ADC1_IN7
  • nc
  • nc
  • nc SPI1_MOSI : PA7
    nc competes with ADC1_IN8

Devicetree compatible

WeAct BluePill+ edge pinout

Supported Features

The WeAct 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_NEXT

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

st,stm32f1-rcc

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 WeAct BluePill+ boards can be configured for the following different use cases.

west build -b weact_bluepillplus_stm32f103cb -S usb-console

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

west build -b weact_bluepillplus_stm32f103cb

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

System and Real-Time Clock

The STM32 system clock (SYSCLK) on the WeAct 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 up to 144㎒ on the other counterfeited chips, 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 WeAct 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 WeAct BluePill+ boards feature one LED for user purposes at GPIO port B line 2 (PB2) in parallel to the BOOT1 signal. The LED is high active.

User Button

The WeAct BluePill+ boards feature one tactile push button for user purposes at GPIO port A line 0 (PA0) in parallel to the WKUP signal and the first ADC channel. The push button is high active.

ADC/TS Ports

The WeAct 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 WeAct 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 WeAct 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 WeAct BluePill+ boards with STM32F1 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 [6] 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 WeAct 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 WeAct BluePill+ boards with STM32F1 features one (native) USB full-speed device port that can be used to communicate with a host PC. See the USB sample applications for more, such as the USB CDC ACM UART sample 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.03
USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: BluePill+ STM32F103 (CDC ACM)
Manufacturer: WeAct (STMicroelectronics)
SerialNumber: 93F49F68D18508F0

Programming and Debugging

Applications for the WeAct 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 WeAct 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 WeAct BluePill+ board:

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

Build and flash the application:

west build -b weact_bluepillplus_stm32f103c8 -p -d build/weact_bluepillplus zephyr/samples/hello_world
west flash -r openocd -d build/weact_bluepillplus

You should see the following message on the console:

*** Booting Zephyr OS build v4.3.0***
Hello World! weact_bluepillplus_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 weact_bluepillplus_stm32f103c8 -p -d build/weact_bluepillplus zephyr/samples/hello_world
west debug -r openocd -d build/weact_bluepillplus

Tests and Examples

LED Blinky with USB-CDC/ACM Console

west build -b weact_bluepillplus_stm32f103cb -p -S "usb-console" -d build/weact_bluepillplus zephyr/samples/basic/blinky
west flash -r openocd -d build/weact_bluepillplus

Hello Shell

west build -b weact_bluepillplus_stm32f103cb -p -d build/weact_bluepillplus bridle/samples/helloshell -- \
-DEXTRA_CONF_FILE="prj-hwstartup.conf" -DCONFIG_STM32_ENABLE_DEBUG_SLEEP_STOP=y
west flash -r openocd -d build/weact_bluepillplus

References