1.. zephyr:board:: olimex_stm32_h405 2 3Overview 4******** 5 6The OLIMEX-STM32-H405 board is based on the STMicroelectronics STM32F405RG ARM 7Cortex-M4 CPU. 8 9Hardware 10******** 11 12Information about the board can be found at the 13`OLIMEX-STM32-H405 website`_ and `OLIMEX-STM32-H405 user manual`_. 14The `ST STM32F405RG Datasheet`_ contains the processor's 15information and the datasheet. 16 17Supported Features 18================== 19 20The olimex_stm32_h405 board configuration supports the following 21hardware features: 22 23+-----------+------------+-------------------------+ 24| Interface | Controller | Driver/Component | 25+===========+============+=========================+ 26| NVIC | on-chip | nested vectored | 27| | | interrupt controller | 28+-----------+------------+-------------------------+ 29| SYSTICK | on-chip | system clock | 30+-----------+------------+-------------------------+ 31| UART | on-chip | serial port | 32+-----------+------------+-------------------------+ 33| GPIO | on-chip | gpio | 34+-----------+------------+-------------------------+ 35| USB | on-chip | USB device | 36+-----------+------------+-------------------------+ 37| WATCHDOG | on-chip | independent watchdog | 38+-----------+------------+-------------------------+ 39| COUNTER | on-chip | rtc | 40+-----------+------------+-------------------------+ 41| RNG | on-chip | random number generator | 42+-----------+------------+-------------------------+ 43 44Other hardware features have not been enabled yet for this board. 45 46 47Pin Mapping 48=========== 49 50LED 51--- 52 53* USER_LED (green) = PC12 54* PWR_LED (red) = power 55 56Push buttons 57------------ 58 59* USER_BUTTON = PA0 60* RST = NRST 61 62External Connectors 63------------------- 64 65JTAG debug 66 67+-------+--------------+-------+--------------+ 68| PIN # | Signal Name | Pin # | Signal Name | 69+=======+==============+=======+==============+ 70| 1 | +3.3V | 2 | +3.3V | 71+-------+--------------+-------+--------------+ 72| 3 | PB4 / TRST | 4 | GND | 73+-------+--------------+-------+--------------+ 74| 5 | PA15 / TDI | 6 | GND | 75+-------+--------------+-------+--------------+ 76| 7 | PA13 / TMS | 8 | GND | 77+-------+--------------+-------+--------------+ 78| 9 | PA14 / TCK | 10 | GND | 79+-------+--------------+-------+--------------+ 80| 11 | GND | 12 | GND | 81+-------+--------------+-------+--------------+ 82| 13 | PB3 / TDO | 14 | GND | 83+-------+--------------+-------+--------------+ 84| 15 | GND | 16 | GND | 85+-------+--------------+-------+--------------+ 86| 17 | RST | 18 | GND | 87+-------+--------------+-------+--------------+ 88| 19 | GND | 20 | GND | 89+-------+--------------+-------+--------------+ 90 91USB Type B 92 93+-------+------------------+ 94| PIN # | Signal Name | 95+=======+==================+ 96| 1 | +5V_USB | 97+-------+------------------+ 98| 2 | PA11 / USBDM | 99+-------+------------------+ 100| 3 | PA12 / USBDP | 101+-------+------------------+ 102| 4 | GND | 103+-------+------------------+ 104 105EXT1 header 106 107+-------+------------------+-------+------------------+ 108| PIN # | Signal Name | Pin # | Signal Name | 109+=======+==================+=======+==================+ 110| 1 | | 2 | | 111+-------+------------------+-------+------------------+ 112| ... | ... | ... | ... | 113+-------+------------------+-------+------------------+ 114| 9 | PC11 (USB DISC) | 10 | PC12 (LED) | 115+-------+------------------+-------+------------------+ 116| ... | ... | ... | ... | 117+-------+------------------+-------+------------------+ 118| 25 | | 26 | | 119+-------+------------------+-------+------------------+ 120 121EXT2 header 122 123+-------+------------------+-------+------------------+ 124| PIN # | Signal Name | Pin # | Signal Name | 125+=======+==================+=======+==================+ 126| 1 | | 2 | | 127+-------+------------------+-------+------------------+ 128| ... | ... | ... | ... | 129+-------+------------------+-------+------------------+ 130| 5 | | 6 | GND | 131+-------+------------------+-------+------------------+ 132| 7 | PA2 / USART2_TX | 8 | | 133+-------+------------------+-------+------------------+ 134| 9 | | 10 | PA3 / USART2_RX | 135+-------+------------------+-------+------------------+ 136| ... | ... | ... | ... | 137+-------+------------------+-------+------------------+ 138| 25 | | 26 | | 139+-------+------------------+-------+------------------+ 140 141 142System Clock 143============ 144 145OLIMEX-STM32-H405 has two external oscillators. The frequency of 146the slow clock is 32.768 kHz. The frequency of the main clock 147is 8 MHz. The processor can setup HSE to drive the master clock, 148which can be set as high as 168 MHz. 149 150Programming and Debugging 151************************* 152The OLIMEX-STM32-H405 board does not include an embedded debug tool 153interface. You will need to use ST tools or an external JTAG probe. 154In the following examples a ST-Link V2 USB dongle is used. 155 156Flashing an application to the Olimex-STM32-H405 157================================================ 158 159The sample application :zephyr:code-sample:`hello_world` is being used in this tutorial. 160 161Connect the ST-Link USB dongle to your host computer and to the JTAG port of 162the OLIMEX-STM32-H405 board. 163 164Now build and flash the application. 165 166.. zephyr-app-commands:: 167 :zephyr-app: samples/hello_world 168 :board: olimex_stm32_h405 169 :goals: build flash 170 171Run a serial host program to connect with your board: 172 173.. code-block:: console 174 175 $ minicom -D /dev/ttyACM0 176 177After resetting the board, you should see the following message: 178 179.. code-block:: console 180 181 *** Booting Zephyr OS build v2.7.99-3008-g2341052abe7c *** 182 Hello World! olimex_stm32_h405 183 184 185Debugging 186========= 187 188You can debug an application in the usual way. Here is an example for the 189:zephyr:code-sample:`hello_world` application. 190 191.. zephyr-app-commands:: 192 :zephyr-app: samples/hello_world 193 :board: olimex_stm32_h405 194 :maybe-skip-config: 195 :goals: debug 196 197.. _OLIMEX-STM32-H405 website: 198 https://www.olimex.com/Products/ARM/ST/STM32-H405/ 199 200.. _OLIMEX-STM32-H405 user manual: 201 https://www.olimex.com/Products/ARM/ST/STM32-H405/resources/STM32-H405_UM.pdf 202 203.. _ST STM32F405RG Datasheet: 204 https://www.st.com/resource/en/reference_manual/dm00031020.pdf 205