Skip to content

Commit b78c51c

Browse files
committed
boards: st: Add support for stm32mp135f_dk board
Add support for STM32MP135F DK board. Signed-off-by: Julien Racki <[email protected]>
1 parent 6ca2db6 commit b78c51c

File tree

10 files changed

+352
-0
lines changed

10 files changed

+352
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_STM32MP135F_DK
5+
select SOC_STM32MP135FXX
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2025 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
5+
6+
board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd.cfg")

boards/st/stm32mp135f_dk/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: stm32mp135f_dk
3+
full_name: STM32MP135F-DK Discovery
4+
vendor: st
5+
socs:
6+
- name: stm32mp135fxx
38.7 KB
Loading
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
.. zephyr:board:: stm32mp135f_dk
2+
3+
Overview
4+
********
5+
The STM32MP135 Discovery kit (STM32MP135F-DK) leverages the capabilities of the
6+
1 GHz STM32MP135 microprocessors to allow users to develop applications easily with Zephyr RTOS.
7+
8+
It includes an ST-LINK embedded debug tool, LEDs, push-buttons, two 10/100 Mbit/s Ethernet (RMII) connectors, one USB Type-C |reg| connector, four USB Host Type-A connectors, and one microSD™ connector.
9+
10+
To expand the functionality of the STM32MP135 Discovery kit, one GPIO expansion connector is also available for third-party shields.
11+
12+
Additionally, the STM32MP135 Discovery kit features an LCD display with a touch panel, Wi‑Fi |reg| and Bluetooth |reg| Low Energy capability, and a 2-megapixel CMOS camera module.
13+
14+
It also provides secure boot and cryptography features.
15+
16+
Zephyr OS is ported to run on the Cortex |reg|-A7 core.
17+
18+
- STM32MP135FAF7: Arm |reg| Cortex |reg|-A7 32-bit processor at 1 GHz, in a TFBGA320 package
19+
- ST PMIC STPMIC1
20+
- 4-Gbit DDR3L, 16 bits, 533 MHz
21+
- 4.3" 480x272 pixels LCD display module with capacitive touch panel and RGB interface
22+
- UXGA 2-megapixel CMOS camera module (included) with MIPI CSI-2 |reg| / SMIA CCP2 deserializer
23+
- Wi-Fi |reg| 802.11b/g/n
24+
- Bluetooth |reg| Low Energy 4.1
25+
- Dual 10/100 Mbit/s Ethernet (RMII) compliant with IEEE-802.3u, one with Wake on LAN (WoL) support
26+
- USB Host 4-port hub
27+
- USB Type-C |reg| DRP based on an STM32G0 device
28+
- 4 user LEDs
29+
- 4 push-buttons (2× user, tamper, and reset)
30+
- 1 wake-up button
31+
- Board connectors:
32+
33+
- Dual-lane MIPI CSI-2 |reg| camera module expansion
34+
- 2x Ethernet RJ45
35+
- 4x USB Type-A
36+
- USB Micro-B
37+
- USB Type-C |reg|
38+
- microSD™ card holder
39+
- GPIO expansion
40+
- 5 V / 3 A USB Type-C |reg| power supply input (charger not provided)
41+
- VBAT for power backup
42+
43+
- On-board current measurement
44+
- On-board STLINK-V3E debugger/programmer with USB re-enumeration capability:
45+
46+
- mass storage
47+
- Virtual COM port
48+
- debug port
49+
50+
More information about the board can be found at the
51+
`STM32P135 Discovery website`_.
52+
53+
Hardware
54+
********
55+
56+
More information about the STM32MP135F_DK board hardware can be found here:
57+
58+
- `STM32MP135F_DK Hardware Description`_
59+
60+
More information about STM32P135F microprocessor can be found here:
61+
62+
- `STM32MP135F on www.st.com`_
63+
- `STM32MP135F reference manual`_
64+
65+
Supported Features
66+
==================
67+
68+
.. zephyr:board-supported-hw::
69+
70+
Connections and IOs
71+
===================
72+
73+
STM32MP135F-DK Discovery Board schematic is available here:
74+
`STM32MP135F Discovery board schematics`_.
75+
76+
77+
Default Zephyr Peripheral Mapping:
78+
----------------------------------
79+
80+
- USART_4 TX/RX : PD6/PD8 (UART console)
81+
82+
- USER_BUTTON : PA13
83+
- LED_3 : PA14
84+
- LED_4 : PA13
85+
86+
System Clock
87+
------------
88+
89+
The Cortex |reg|-A7 core is configured to run at a clock speed of up to 1GHz.
90+
91+
Memory mapping
92+
--------------
93+
94+
+------------+-----------------------+----------------+
95+
| Region | Address | Size |
96+
+============+=======================+================+
97+
| SYSRAM | 0x2FFE0000-0x2FFFFFFF | 128KB |
98+
+------------+-----------------------+----------------+
99+
| SRAM 1 | 0x30000000-0x30003FFF | 16KB |
100+
+------------+-----------------------+----------------+
101+
| SRAM 2 | 0x30004000-0x30005FFF | 8KB |
102+
+------------+-----------------------+----------------+
103+
| SRAM 3 | 0x30006000-0x30007FFF | 8KB |
104+
+------------+-----------------------+----------------+
105+
| DDR | 0xC0000000-0xDFFFFFFF | 512 MB |
106+
+------------+-----------------------+----------------+
107+
108+
Programming and Debugging
109+
*************************
110+
111+
Prerequisite
112+
============
113+
114+
The STM32MP135 has a DDR controller that need to be initialized before loading the Zephyr example.
115+
116+
One method to perform this is to flash the Zephyr executable, along with the DDR initialization script, on an SD card inserted in the board. To do so, you first need to :ref:`install STM32CubeProgrammer <stm32cubeprog-flash-host-tools>` and download the `STM32CubeMP13 package`_.
117+
118+
Signature and flashing
119+
======================
120+
121+
After building the Zephyr project, you need to sign your binary file using the Stm32ImageAddHeader.py with the following command:
122+
123+
.. code-block:: console
124+
125+
python3 ${Path_to_STM32CubeMP13}/Utilities/ImageHeader/Python3/Stm32ImageAddHeader.py ${Path_to_build_dir}/zephyr/zephyr.bin ${STM32CubeMP13}/Projects/STM32MP135C-DK/External_Loader/Prebuild_Binaries/SD_Ext_Loader/zephyr_Signed.bin -bt 10 -la C0000000 -ep C0000000
126+
127+
Here -bt specifies the boot type, -la specifies the load address and -ep the entry point for your executable (same as the load address in this case).
128+
129+
Then, copy :zephyr_file:`boards/st/stm32mp135f_dk/support/Zephyr.tsv` to ``${Path_to_STM32CubeMP13}/Projects/STM32MP135C-DK/External_Loader/Prebuild_Binaries/SD_Ext_Loader/``.
130+
131+
Finally using the Cube Programmer select the Zephyr.tsv and flash the SD card with the following command:
132+
133+
.. code-block:: console
134+
135+
${Path_to_STM32cube_Programmer}/bin/STM32_Programmer.sh -c port=${ConnectedPort} p=even br=115200 -d ${Path_to_STM32CubeMP13}/Projects/STM32MP135C-DK/External_Loader/Prebuild_Binaries/SD_Ext_Loader/Zephyr.tsv
136+
137+
.. note::
138+
You can refer to this example to flash an example to the SD card:
139+
`How to install STM32Cube software package on microSD card`_
140+
141+
Debugging
142+
=========
143+
144+
You can debug an application using OpenOCD and GDB.
145+
146+
- Build the sample:
147+
148+
.. zephyr-app-commands::
149+
:zephyr-app: samples/hello_world
150+
:board: stm32mp135f_dk
151+
:goals: build
152+
153+
- Flash the SD card using:
154+
`How to install STM32Cube software package on microSD card`_
155+
156+
- Run the application from the SD card
157+
158+
- Attach to the target:
159+
160+
.. code-block:: console
161+
162+
west attach
163+
164+
.. note::
165+
The ``run`` command of GDB isn't supported at the moment for this board.
166+
167+
References
168+
**********
169+
170+
.. target-notes::
171+
172+
.. _STM32P135 Discovery website:
173+
https://www.st.com/en/evaluation-tools/stm32mp135f-dk.html
174+
175+
.. _STM32MP135F Discovery board User Manual:
176+
https://www.st.com/resource/en/user_manual/dm00862450.pdf
177+
178+
.. _STM32MP135F Discovery board schematics:
179+
https://www.st.com/resource/en/schematic_pack/mb1635-mp135f-e02-schematic.pdf
180+
181+
.. _STM32MP135F on www.st.com:
182+
https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-arm-cortex-mpus/stm32mp1-series/stm32mp135/stm32mp135f.html
183+
184+
.. _STM32MP135F reference manual:
185+
https://www.st.com/resource/en/reference_manual/DM00670465-.pdf
186+
187+
.. _STM32MP135 STM32Cube software package:
188+
https://www.st.com/en/embedded-software/stm32cubemp13.html#get-software
189+
190+
.. _How to install STM32Cube software package on microSD card:
191+
https://wiki.st.com/stm32mpu/wiki/How_to_load_and_start_STM32CubeMP13_applications_via_microSD_card
192+
193+
.. _STM32MP135F boot architecture:
194+
https://wiki.st.com/stm32mpu/wiki/STM32CubeMP13_package_-_boot_architecture
195+
196+
.. _STM32MP135F baremetal distribution:
197+
https://wiki.st.com/stm32mpu/wiki/Category:Bare_metal_-_RTOS_embedded_software
198+
199+
.. _STM32CubeMP13 package:
200+
https://github.com/STMicroelectronics/STM32CubeMP13
201+
202+
.. _STM32MP135F_DK Hardware Description:
203+
https://wiki.stmicroelectronics.cn/stm32mpu/wiki/STM32MP135x-DK_-_hardware_description
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <st/mp13/stm32mp135.dtsi>
10+
#include <st/mp13/stm32mp135faex-pinctrl.dtsi>
11+
#include <zephyr/dt-bindings/input/input-event-codes.h>
12+
13+
/ {
14+
model = "STMicroelectronics STM32MP135-DK board";
15+
compatible = "st,stm32mp135f-dk";
16+
17+
chosen {
18+
zephyr,flash = &ddr_code;
19+
zephyr,sram = &ddr_data;
20+
zephyr,console = &uart4;
21+
zephyr,shell-uart = &uart4;
22+
};
23+
24+
gpio_keys {
25+
compatible = "gpio-keys";
26+
27+
user_button: button {
28+
label = "User 1";
29+
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
30+
zephyr,code = <INPUT_KEY_0>;
31+
};
32+
};
33+
34+
leds {
35+
compatible = "gpio-leds";
36+
37+
blue_led_1: led_1 {
38+
gpios = <&gpioa 14 GPIO_ACTIVE_HIGH>;
39+
label = "LD3";
40+
};
41+
42+
red_led_2: led_2 {
43+
gpios = <&gpioa 13 GPIO_ACTIVE_HIGH>;
44+
label = "LD4";
45+
};
46+
};
47+
48+
aliases {
49+
led0 = &blue_led_1;
50+
led1 = &red_led_2;
51+
sw0 = &user_button;
52+
};
53+
};
54+
55+
&clk_hsi {
56+
clock-frequency = <DT_FREQ_M(64)>;
57+
status = "okay";
58+
};
59+
60+
&clk_hse {
61+
clock-frequency = <DT_FREQ_M(24)>;
62+
status = "okay";
63+
};
64+
65+
&cpusw {
66+
clocks = <&clk_hsi>;
67+
clock-frequency = <DT_FREQ_M(64)>;
68+
status = "okay";
69+
};
70+
71+
&pll1 {
72+
clocks = <&clk_hse>;
73+
div-m = <2>;
74+
mul-n = <83>;
75+
div-p = <1>;
76+
frac-v = <2730>;
77+
status = "okay";
78+
};
79+
80+
&rcc {
81+
clock-frequency = <DT_FREQ_M(1000)>;
82+
clocks = <&pll>;
83+
ahb-prescaler = <1>;
84+
apb1-prescaler = <1>;
85+
apb2-prescaler = <1>;
86+
};
87+
88+
&uart4 {
89+
pinctrl-names = "default";
90+
pinctrl-0 = <&uart4_tx_pd6 &uart4_rx_pd8>;
91+
current-speed = <115200>;
92+
status = "okay";
93+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2025, STMicroelectronics
2+
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# Enable GPIO
6+
CONFIG_GPIO=y
7+
8+
# Enable UART driver
9+
CONFIG_SERIAL=y
10+
CONFIG_UART_INTERRUPT_DRIVEN=y
11+
12+
# Console (remote proc console by default)
13+
CONFIG_CONSOLE=y
14+
15+
# UART console (overrides remote proc console)
16+
CONFIG_UART_CONSOLE=y
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#Opt Id Name Type IP Offset Binary
2+
P 0x1 fsbl-openbl Binary none 0x0 External_Mem_Loader_A7.stm32
3+
P 0x3 fsbl-extfl Binary none 0x0 SD_Ext_Loader.bin
4+
P 0x4 fsbl-app Binary mmc0 0x0000080 FSBLA_Sdmmc1_A7_Signed.bin
5+
P 0x5 fsbl-app Binary mmc0 0x0000500 zephyr_Signed.bin
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source [find board/stm32mp13x_dk.cfg]
2+
3+
# Don't reset the SoC to keep DDR configuration
4+
reset_config none
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
identifier: stm32mp135f_dk
2+
name: ST STM32MP135F-DK Discovery
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
supported:
9+
- gpio
10+
- uart
11+
- shell
12+
ram: 256
13+
flash: 256
14+
vendor: st

0 commit comments

Comments
 (0)