1.. _blackpill_f401cc: 2 3WeAct Studio Black Pill V1.2 4############################ 5 6Overview 7******** 8 9The WeAct Black Pill V1.2 Board is an extremely low cost and bare-bones 10development board featuring the STM32F401CC, see `STM32F401CC website`_. 11This is the 48-pin variant of the STM32F401x series, 12see `STM32F401x reference manual`_. More info about the board available 13`here <stm32-base-board-page_>`_ and on `WeAct Github`_. 14 15.. image:: img/blackpill-v3.jpg 16 :align: center 17 :alt: Black Pill V3.0+ 18 19Hardware 20******** 21 22The STM32F401CC based Black Pill V3.0+ Board provides the following 23hardware components: 24 25- STM32F401CCU6 in UFQFPN48 package 26- ARM |reg| 32-bit Cortex |reg| -M4 CPU with FPU 27- 84 MHz max CPU frequency 28- VDD from 1.7 V to 3.6 V 29- 256 KB Flash 30- 64 KB SRAM 31- GPIO with external interrupt capability 32- 1x12-bit, 2.4 MSPS ADC with 16 channels 33- DMA Controller 34- Up to 11 Timers (six 16-bit, two 32-bit, two watchdog timers and a SysTick timer) 35- USART/UART (3) 36- I2C (3) 37- SPI/I2S (5) 38- SDIO 39- USB 2.0 full-speed device/host/OTG controller with on-chip PHY 40- CRC calculation unit 41- 96-bit unique ID 42- RTC 43 44Supported Features 45================== 46 47The Zephyr blackpill_f401ce board configuration supports the following 48hardware features: 49 50+------------+------------+-------------------------------------+ 51| Interface | Controller | Driver/Component | 52+============+============+=====================================+ 53| NVIC | on-chip | nested vector interrupt controller | 54+------------+------------+-------------------------------------+ 55| SYSTICK | on-chip | system clock | 56+------------+------------+-------------------------------------+ 57| UART | on-chip | serial port | 58+------------+------------+-------------------------------------+ 59| GPIO | on-chip | gpio | 60+------------+------------+-------------------------------------+ 61| PINMUX | on-chip | pinmux | 62+------------+------------+-------------------------------------+ 63| FLASH | on-chip | flash | 64+------------+------------+-------------------------------------+ 65| SPI | on-chip | spi | 66+------------+------------+-------------------------------------+ 67| I2C | on-chip | i2c | 68+------------+------------+-------------------------------------+ 69| ADC | on-chip | ADC Controller | 70+------------+------------+-------------------------------------+ 71| USB OTG FS | on-chip | USB device | 72+------------+------------+-------------------------------------+ 73 74The default configuration can be found in 75:zephyr_file:`boards/weact/blackpill_f401ce/blackpill_f401ce_defconfig` 76 77Pin Mapping 78=========== 79 80Available pins: 81--------------- 82.. image:: img/Blackpill_Pinout.jpg 83 :align: center 84 :alt: Black Pill V1.2 Pinout 85 86Default Zephyr Peripheral Mapping: 87---------------------------------- 88 89- UART_1 TX/RX : PA9/PA10 90- I2C1 SCL/SDA : PB8/PB9 91- SPI1 CS/SCK/MISO/MOSI : PA4/PA5/PA6/PA7 (Routed to footprint for external flash) 92- PWM_4_CH1 : PB6 93- PWM_4_CH2 : PB7 94- ADC_1 : PA1 95- USER_PB : PA0 96- USER_LED : PC13 97 98Clock Sources 99------------- 100 101The board has two external oscillators. The frequency of the slow clock (LSE) is 10232.768 kHz. The frequency of the main clock (HSE) is 25 MHz. 103 104The default configuration sources the system clock from the PLL, which is 105derived from HSE, and is set at 84MHz, which is the maximum possible frequency 106to achieve a stable USB clock (42MHz). 107 108Programming and Debugging 109************************* 110 111There are 2 main entry points for flashing STM32F4X SoCs, one using the ROM 112bootloader, and another by using the SWD debug port (which requires additional 113hardware). Flashing using the ROM bootloader requires a special activation 114pattern, which can be triggered by using the BOOT0 pin. 115 116Flashing 117======== 118 119Installing dfu-util 120------------------- 121 122It is recommended to use at least v0.8 of `dfu-util`_. The package available in 123debian/ubuntu can be quite old, so you might have to build dfu-util from source. 124 125There is also a Windows version which works, but you may have to install the 126right USB drivers with a tool like `Zadig`_. 127 128Flashing an Application 129----------------------- 130 131Connect a USB-C cable and the board should power ON. Force the board into DFU mode 132by keeping the BOOT0 switch pressed while pressing and releasing the NRST switch. 133 134The dfu-util runner is supported on this board and so a sample can be built and 135tested easily. 136 137.. zephyr-app-commands:: 138 :zephyr-app: samples/basic/blinky 139 :board: blackpill_f401cc 140 :goals: build flash 141 142Debugging 143========= 144 145The board can be debugged by installing the included 100 mil (0.1 inch) header, 146and attaching an SWD debugger to the 3V3 (3.3V), GND, SCK, and DIO 147pins on that header. 148 149References 150********** 151 152.. target-notes:: 153 154.. _board release notes: 155 https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1/blob/master/HDK/README.md 156 157.. _Zadig: 158 https://zadig.akeo.ie/ 159 160.. _WeAct Github: 161 https://github.com/WeActStudio/WeActStudio.MiniSTM32F4x1 162 163.. _stm32-base-board-page: 164 https://stm32-base.org/boards/STM32F401CCU6-WeAct-Black-Pill-V1.2.html 165 166.. _dfu-util: 167 http://dfu-util.sourceforge.net/build.html 168 169.. _STM32F401CC website: 170 https://www.st.com/en/microcontrollers/stm32f401cc.html 171 172.. _STM32F401x reference manual: 173 https://www.st.com/resource/en/reference_manual/dm00096844.pdf 174