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