Skip to content

Commit 865fbbc

Browse files
gautierg-stkartben
authored andcommitted
boards: st: stm32n6570_dk: add support for stm32n6570_dk board
Add support for STM32N657 DK board. Signed-off-by: Guillaume Gautier <[email protected]>
1 parent 5e40b65 commit 865fbbc

File tree

8 files changed

+345
-0
lines changed

8 files changed

+345
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 STMicroelectronics
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_STM32N6570_DK
5+
select SOC_STM32N657XX

boards/st/stm32n6570_dk/board.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2024 STMicroelectronics
3+
4+
board_runner_args(stm32cubeprogrammer "--port=swd")
5+
board_runner_args(stm32cubeprogrammer "--tool-opt= mode=HOTPLUG ap=1")
6+
board_runner_args(stm32cubeprogrammer "--extload=MX66UW1G45G_STM32N6570-DK.stldr")
7+
board_runner_args(stm32cubeprogrammer "--download-address=0x70000000")
8+
9+
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)

boards/st/stm32n6570_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: stm32n6570_dk
3+
full_name: STM32N6570-DK
4+
vendor: st
5+
socs:
6+
- name: stm32n657xx
Binary file not shown.

boards/st/stm32n6570_dk/doc/index.rst

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
.. zephyr:board:: stm32n6570_dk
2+
3+
Overview
4+
********
5+
6+
The STM32N6570_DK Discovery kit is a complete demonstration and development platform
7+
for the Arm® Cortex®‑M55 core‑based STM32N657X0H3Q microcontroller.
8+
9+
The STM32N6570_DK Discovery kit includes a full range of hardware features that help
10+
the user evaluate many peripherals, such as USB Type-C®, Octo‑SPI flash memory and
11+
Hexadeca‑SPI PSRAM devices, Ethernet, camera module, LCD, microSD™, audio codec,
12+
digital microphones, ADC, flexible extension connectors, and user button.
13+
The four flexible extension connectors feature easy and unlimited expansion capabilities
14+
for specific applications such as wireless connectivity, analog applications, and sensors.
15+
16+
The STM32N657X0H3Q microcontroller features one USB 2.0 high‑speed/full‑speed
17+
Device/Host/OTG controller, one USB 2.0 high‑speed/full‑speed Device/Host/OTG controller
18+
with UCPD (USB Type-C® Power Delivery), one Ethernet with TSN (time-sensitive networking),
19+
four I2Cs, two I3Cs, six SPIs (of which four I2S‑capable), two SAIs, with four DMIC support,
20+
five USARTs, five UARTs (ISO78916 interface, LIN, IrDA, up to 12.5 Mbit/s), one LPUART,
21+
two SDMMCs (MMC version 4.0, CE-ATA version 1.0, and SD version 1.0.1), three CAN FD
22+
with TTCAN capability, JTAG and SWD debugging support, and Embedded Trace Macrocell™ (ETM).
23+
24+
The STM32N6570_DK Discovery kit integrates an STLINK-V3EC embedded in-circuit debugger and
25+
programmer for the STM32 MCU, with a USB Virtual COM port bridge and the comprehensive MCU Package.
26+
27+
Hardware
28+
********
29+
30+
- STM32N657X0H3Q Arm® Cortex®‑M55‑based microcontroller featuring ST Neural-ART Accelerator,
31+
H264 encoder, NeoChrom 2.5D GPU, and 4.2 Mbytes of contiguous SRAM, in a VFBGA264 package
32+
- 5" LCD module with capacitive touch panel
33+
- USB Type-C® with USB 2.0 HS interface, dual‑role‑power (DRP)
34+
- USB Type-A with USB 2.0 HS interface, host, 0.5 A max
35+
- 1‑Gbit Ethernet with TSN (time-sensitive networking) compliant with IEEE‑802.3‑2002
36+
- SAI audio codec
37+
- One MEMS digital microphone
38+
- 1‑Gbit Octo‑SPI flash memory
39+
- 256-Mbit Hexadeca‑SPI PSRAM
40+
- Two user LEDs
41+
- User, tamper, and reset push-buttons
42+
- Board connectors:
43+
44+
- USB Type-C®
45+
- USB Type-A
46+
- Ethernet RJ45
47+
- Camera module
48+
- microSD™ card
49+
- LCD
50+
- Stereo headset jack including analog microphone input
51+
- Audio MEMS daughterboard expansion connector
52+
- ARDUINO® Uno R3 expansion connector
53+
- STMod+ expansion connector
54+
55+
- On-board STLINK-V3EC debugger/programmer with USB re-enumeration capability:
56+
Virtual COM port, and debug port
57+
58+
59+
Supported Features
60+
==================
61+
62+
The Zephyr ``stm32n6570_dk`` board supports the following hardware features:
63+
64+
+-----------+------------+-------------------------------------+
65+
| Interface | Controller | Driver/Component |
66+
+===========+============+=====================================+
67+
| CLOCK | on-chip | reset and clock control |
68+
+-----------+------------+-------------------------------------+
69+
| GPIO | on-chip | gpio |
70+
+-----------+------------+-------------------------------------+
71+
| NVIC | on-chip | nested vector interrupt controller |
72+
+-----------+------------+-------------------------------------+
73+
| UART | on-chip | serial port-polling; |
74+
| | | serial port-interrupt |
75+
+-----------+------------+-------------------------------------+
76+
77+
78+
Other hardware features are not yet supported on this Zephyr port.
79+
80+
The default configuration can be found in the defconfig file:
81+
:zephyr_file:`boards/st/stm32n6570_dk/stm32n6570_dk_defconfig`
82+
83+
84+
Connections and IOs
85+
===================
86+
87+
STM32N6570_DK Board has 12 GPIO controllers. These controllers are responsible
88+
for pin muxing, input/output, pull-up, etc.
89+
90+
For more details please refer to `STM32N6570_DK User Manual`_.
91+
92+
Default Zephyr Peripheral Mapping:
93+
----------------------------------
94+
95+
- LD1 : PO1
96+
- LD2 : PG10
97+
- USART_1_TX : PE5
98+
- USART_1_RX : PE6
99+
100+
System Clock
101+
------------
102+
103+
STM32N6570_DK System Clock could be driven by internal or external oscillator,
104+
as well as main PLL clock. By default System clock is driven by PLL clock at
105+
400MHz, driven by 64MHz high speed internal oscillator.
106+
107+
Serial Port
108+
-----------
109+
110+
STM32N6570_DK board has 10 U(S)ARTs. The Zephyr console output is assigned to
111+
USART1. Default settings are 115200 8N1.
112+
113+
Programming and Debugging
114+
*************************
115+
116+
STM32N6570_DK board includes an ST-LINK/V3 embedded debug tool interface.
117+
This probe allows to flash the board using various tools.
118+
119+
Flashing
120+
========
121+
122+
The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
123+
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.
124+
Version 2.18.0 or later of `STM32CubeProgrammer`_ is required.
125+
126+
Flashing an application to STM32N6570_DK
127+
------------------------------------------
128+
129+
Connect the STM32N6570_DK to your host computer using the USB port.
130+
Then build and flash an application.
131+
132+
.. note::
133+
For flashing, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on
134+
the board.
135+
136+
To run the application after flashing, BOOT1 should be set to 0 and the board
137+
should be powered off and on again.
138+
139+
Here is an example for the :zephyr:code-sample:`hello_world` application.
140+
141+
Run a serial host program to connect with your Disco board:
142+
143+
.. code-block:: console
144+
145+
$ minicom -D /dev/ttyACM0
146+
147+
Then build and flash the application.
148+
149+
.. zephyr-app-commands::
150+
:zephyr-app: samples/hello_world
151+
:board: stm32n6570_dk
152+
:goals: build flash
153+
154+
You should see the following message on the console:
155+
156+
.. code-block:: console
157+
158+
Hello World! stm32n6570_dk/stm32n657xx
159+
160+
161+
Debugging
162+
=========
163+
164+
For now debugging is only available through STM32CubeIDE:
165+
* Go to File > Import and select C/C++ > STM32 Cortex-M Executable
166+
* In Executable field, browse to your <ZEPHYR_PATH>/build/zephyr/zephyr.elf
167+
* In MCU field, select STM32N657X0HxQ.
168+
* Click on Finish
169+
* Then click on Debug to start the debugging session
170+
171+
.. note::
172+
For debugging, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on the
173+
board.
174+
175+
.. _STM32N6570_DK website:
176+
https://www.st.com/en/evaluation-tools/stm32n6570-dk.html
177+
178+
.. _STM32N6570_DK User Manual:
179+
https://www.st.com/resource/en/user_manual/um3300-discovery-kit-with-stm32n657x0-mcu-stmicroelectronics.pdf
180+
181+
.. _STM32N657X0 on www.st.com:
182+
https://www.st.com/en/microcontrollers-microprocessors/stm32n657x0.html
183+
184+
.. _STM32N657 reference manual:
185+
https://www.st.com/resource/en/reference_manual/rm0486-stm32n647657xx-armbased-32bit-mcus-stmicroelectronics.pdf
186+
187+
.. _STM32CubeProgrammer:
188+
https://www.st.com/en/development-tools/stm32cubeprog.html
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*
2+
* Copyright (c) 2024 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include <st/n6/stm32n657X0.dtsi>
9+
#include <st/n6/stm32n657x0hxq-pinctrl.dtsi>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
12+
/ {
13+
model = "STMicroelectronics STM32N6570 Discovery Kit board";
14+
compatible = "st,stm32n6570-dk";
15+
16+
chosen {
17+
zephyr,console = &usart1;
18+
zephyr,shell-uart = &usart1;
19+
zephyr,sram = &axisram2;
20+
};
21+
22+
aliases {
23+
led0 = &green_led_1;
24+
};
25+
26+
leds: leds {
27+
compatible = "gpio-leds";
28+
29+
green_led_1: led_1 {
30+
gpios = <&gpioo 1 GPIO_ACTIVE_HIGH>;
31+
label = "User LD1";
32+
};
33+
34+
red_led_1: led_2 {
35+
gpios = <&gpiog 10 GPIO_ACTIVE_HIGH>;
36+
label = "User LD2";
37+
};
38+
};
39+
};
40+
41+
&clk_hsi {
42+
hsi-div = <1>;
43+
status = "okay";
44+
};
45+
46+
&pll1 {
47+
clocks = <&clk_hsi>;
48+
div-m = <4>;
49+
mul-n = <75>;
50+
div-p1 = <1>;
51+
div-p2 = <1>;
52+
status = "okay";
53+
};
54+
55+
&ic1 {
56+
pll-src = <1>;
57+
ic-div = <2>;
58+
status = "okay";
59+
};
60+
61+
&ic2 {
62+
pll-src = <1>;
63+
ic-div = <3>;
64+
status = "okay";
65+
};
66+
67+
&ic6 {
68+
pll-src = <1>;
69+
ic-div = <2>;
70+
status = "okay";
71+
};
72+
73+
&ic11 {
74+
pll-src = <1>;
75+
ic-div = <3>;
76+
status = "okay";
77+
};
78+
79+
&perck {
80+
clocks = <&rcc STM32_SRC_HSI PER_SEL(0)>;
81+
status = "okay";
82+
};
83+
84+
&cpusw {
85+
clocks = <&rcc STM32_SRC_IC1 CPU_SEL(3)>;
86+
clock-frequency = <DT_FREQ_M(600)>;
87+
status = "okay";
88+
};
89+
90+
&rcc {
91+
/* ic2, ic6 & ic11 must all be enabled to set ic2 as SYSCLK */
92+
clocks = <&ic2>;
93+
clock-frequency = <DT_FREQ_M(400)>;
94+
ahb-prescaler = <2>;
95+
apb1-prescaler = <1>;
96+
apb2-prescaler = <1>;
97+
apb4-prescaler = <1>;
98+
apb5-prescaler = <1>;
99+
};
100+
101+
&usart1 {
102+
clocks = <&rcc STM32_CLOCK(APB2, 4)>,
103+
<&rcc STM32_SRC_CKPER USART1_SEL(1)>;
104+
pinctrl-0 = <&usart1_tx_pe5 &usart1_rx_pe6>;
105+
pinctrl-names = "default";
106+
current-speed = <115200>;
107+
status = "okay";
108+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
identifier: stm32n6570_dk
2+
name: STM32N6570 Discovery Kit
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
- xtools
9+
ram: 1024
10+
flash: 0
11+
supported:
12+
- gpio
13+
- uart
14+
vendor: st
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright (c) 2024 STMicroelectronics
3+
4+
# Enable UART driver
5+
CONFIG_SERIAL=y
6+
7+
# Enable GPIO
8+
CONFIG_GPIO=y
9+
10+
# Console
11+
CONFIG_CONSOLE=y
12+
CONFIG_UART_CONSOLE=y
13+
14+
# No internal Flash
15+
CONFIG_XIP=n

0 commit comments

Comments
 (0)