boards: arm: add initial support for OLIMEX STM32-H405 board

The board features a STM32F405RGT6 MCU.

The code is based on boards/arm/olimex_stm32_p405 and
boards/arm/olimex_stm32_h103.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
This commit is contained in:
Antony Pavlov 2020-06-28 09:18:23 +03:00 committed by Anas Nashif
commit 00ba635d58
10 changed files with 397 additions and 0 deletions

View file

@ -0,0 +1,8 @@
# OLIMEX-STM32-H405 board configuration
# Copyright (c) 2020, 2021 Antony Pavlov <antonynpavlov@gmail.com>
# SPDX-License-Identifier: Apache-2.0
config BOARD_OLIMEX_STM32_H405
bool "OLIMEX STM32-H405 Development Board"
depends on SOC_STM32F405XG

View file

@ -0,0 +1,11 @@
# OLIMEX-STM32-H405 board configuration
# Copyright (c) 2020, Antony Pavlov <antonynpavlov@gmail.com>
# SPDX-License-Identifier: Apache-2.0
if BOARD_OLIMEX_STM32_H405
config BOARD
default "olimex_stm32_h405"
endif # BOARD_OLIMEX_STM32_H405

View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
board_runner_args(jlink "--device=STM32F405RG" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -0,0 +1,221 @@
.. _olimex_stm32_h405:
OLIMEX-STM32-H405
#################
Overview
********
The OLIMEX-STM32-H405 board is based on the STMicroelectronics STM32F405RG ARM
Cortex-M4 CPU.
.. figure:: olimex_stm32_h405_top.jpg
:width: 540px
:align: center
:alt: OLIMEX-STM32-H405
OLIMEX-STM32-H405 top
.. figure:: olimex_stm32_h405_bottom.jpg
:width: 540px
:align: center
:alt: OLIMEX-STM32-H405
OLIMEX-STM32-H405 bottom
Hardware
********
Information about the board can be found at the
`OLIMEX-STM32-H405 website`_ and `OLIMEX-STM32-H405 user manual`_.
The `ST STM32F405RG Datasheet`_ contains the processor's
information and the datasheet.
Supported Features
==================
The olimex_stm32_h405 board configuration supports the following
hardware features:
+-----------+------------+-------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=========================+
| NVIC | on-chip | nested vectored |
| | | interrupt controller |
+-----------+------------+-------------------------+
| SYSTICK | on-chip | system clock |
+-----------+------------+-------------------------+
| UART | on-chip | serial port |
+-----------+------------+-------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------+
| USB | on-chip | USB device |
+-----------+------------+-------------------------+
| WATCHDOG | on-chip | independent watchdog |
+-----------+------------+-------------------------+
| COUNTER | on-chip | rtc |
+-----------+------------+-------------------------+
| RNG | on-chip | random number generator |
+-----------+------------+-------------------------+
Other hardware features have not been enabled yet for this board.
Pin Mapping
===========
LED
---
* USER_LED (green) = PC12
* PWR_LED (red) = power
Push buttons
------------
* USER_BUTTON = PA0
* RST = NRST
External Connectors
-------------------
JTAG debug
+-------+--------------+-------+--------------+
| PIN # | Signal Name | Pin # | Signal Name |
+=======+==============+=======+==============+
| 1 | +3.3V | 2 | +3.3V |
+-------+--------------+-------+--------------+
| 3 | PB4 / TRST | 4 | GND |
+-------+--------------+-------+--------------+
| 5 | PA15 / TDI | 6 | GND |
+-------+--------------+-------+--------------+
| 7 | PA13 / TMS | 8 | GND |
+-------+--------------+-------+--------------+
| 9 | PA14 / TCK | 10 | GND |
+-------+--------------+-------+--------------+
| 11 | GND | 12 | GND |
+-------+--------------+-------+--------------+
| 13 | PB3 / TDO | 14 | GND |
+-------+--------------+-------+--------------+
| 15 | GND | 16 | GND |
+-------+--------------+-------+--------------+
| 17 | RST | 18 | GND |
+-------+--------------+-------+--------------+
| 19 | GND | 20 | GND |
+-------+--------------+-------+--------------+
USB Type B
+-------+------------------+
| PIN # | Signal Name |
+=======+==================+
| 1 | +5V_USB |
+-------+------------------+
| 2 | PA11 / USBDM |
+-------+------------------+
| 3 | PA12 / USBDP |
+-------+------------------+
| 4 | GND |
+-------+------------------+
EXT1 header
+-------+------------------+-------+------------------+
| PIN # | Signal Name | Pin # | Signal Name |
+=======+==================+=======+==================+
| 1 | | 2 | |
+-------+------------------+-------+------------------+
| ... | ... | ... | ... |
+-------+------------------+-------+------------------+
| 9 | PC11 (USB DISC) | 10 | PC12 (LED) |
+-------+------------------+-------+------------------+
| ... | ... | ... | ... |
+-------+------------------+-------+------------------+
| 25 | | 26 | |
+-------+------------------+-------+------------------+
EXT2 header
+-------+------------------+-------+------------------+
| PIN # | Signal Name | Pin # | Signal Name |
+=======+==================+=======+==================+
| 1 | | 2 | |
+-------+------------------+-------+------------------+
| ... | ... | ... | ... |
+-------+------------------+-------+------------------+
| 5 | | 6 | GND |
+-------+------------------+-------+------------------+
| 7 | PA2 / USART2_TX | 8 | |
+-------+------------------+-------+------------------+
| 9 | | 10 | PA3 / USART2_RX |
+-------+------------------+-------+------------------+
| ... | ... | ... | ... |
+-------+------------------+-------+------------------+
| 25 | | 26 | |
+-------+------------------+-------+------------------+
System Clock
============
OLIMEX-STM32-H405 has two external oscillators. The frequency of
the slow clock is 32.768 kHz. The frequency of the main clock
is 8 MHz. The processor can setup HSE to drive the master clock,
which can be set as high as 168 MHz.
Programming and Debugging
*************************
The OLIMEX-STM32-H405 board does not include an embedded debug tool
interface. You will need to use ST tools or an external JTAG probe.
In the following examples a ST-Link V2 USB dongle is used.
Flashing an application to the Olimex-STM32-H405
================================================
The sample application :ref:`hello_world` is being used in this tutorial.
Connect the ST-Link USB dongle to your host computer and to the JTAG port of
the OLIMEX-STM32-H405 board.
Now build and flash the application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: olimex_stm32_h405
:goals: build flash
Run a serial host program to connect with your board:
.. code-block:: console
$ minicom -D /dev/ttyACM0
After resetting the board, you should see the following message:
.. code-block:: console
*** Booting Zephyr OS build v2.7.99-3008-g2341052abe7c ***
Hello World! olimex_stm32_h405
Debugging
=========
You can debug an application in the usual way. Here is an example for the
:ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: olimex_stm32_h405
:maybe-skip-config:
:goals: debug
.. _OLIMEX-STM32-H405 website:
https://www.olimex.com/Products/ARM/ST/STM32-H405/
.. _OLIMEX-STM32-H405 user manual:
https://www.olimex.com/Products/ARM/ST/STM32-H405/resources/STM32-H405_UM.pdf
.. _ST STM32F405RG Datasheet:
https://www.st.com/resource/en/reference_manual/dm00031020.pdf

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View file

@ -0,0 +1,90 @@
/*
* Copyright (c) 2020-2022 Antony Pavlov <antonynpavlov@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <st/f4/stm32f405Xg.dtsi>
#include <st/f4/stm32f405rgtx-pinctrl.dtsi>
/ {
model = "Olimex STM32-H405 board";
compatible = "olimex,stm32-h405", "st,stm32f405";
chosen {
zephyr,console = &usart2;
zephyr,shell-uart = &usart2;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,ccm = &ccm0;
};
leds {
compatible = "gpio-leds";
green_led_1: led_1 {
gpios = <&gpioc 12 GPIO_ACTIVE_LOW>;
label = "LED1";
};
};
gpio_keys {
compatible = "gpio-keys";
user_button: button {
label = "Key";
gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
};
};
aliases {
led0 = &green_led_1;
sw0 = &user_button;
};
};
&clk_hse {
clock-frequency = <DT_FREQ_M(8)>;
status = "okay";
};
&pll {
div-m = <4>;
mul-n = <168>;
div-p = <2>;
div-q = <7>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(168)>;
ahb-prescaler = <1>;
apb1-prescaler = <4>;
apb2-prescaler = <2>;
};
&usart2 {
pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
pinctrl-names = "default";
current-speed = <115200>;
status = "okay";
};
&rtc {
status = "okay";
};
&rng {
status = "okay";
};
&iwdg {
status = "okay";
};
zephyr_udc0: &usbotg_fs {
pinctrl-0 = <&usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
pinctrl-names = "default";
status = "okay";
};

View file

@ -0,0 +1,12 @@
identifier: olimex_stm32_h405
name: OLIMEX-STM32-H405
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 128
flash: 1024
supported:
- counter

View file

@ -0,0 +1,25 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_SERIES_STM32F4X=y
CONFIG_SOC_STM32F405XG=y
# Enable MPU
CONFIG_ARM_MPU=y
# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y
CONFIG_SERIAL=y
# console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# enable GPIO
CONFIG_GPIO=y
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# enable pin controller
CONFIG_PINCTRL=y

View file

@ -0,0 +1,24 @@
source [find interface/stlink.cfg]
set WORKAREASIZE 0x10000
transport select hla_swd
source [find target/stm32f4x.cfg]
adapter_khz 1000
adapter_nsrst_delay 100
jtag_ntrst_delay 100
reset_config srst_only srst_nogate
$_TARGETNAME configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}
$_TARGETNAME configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}