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