Skip to content

Commit de426f2

Browse files
erwangokartben
authored andcommitted
boards: stm32n6570_dk: Introduce variant for serial boot
Introduce a variant to allow loading and running firmware using BootROM serial boot configuration. Signed-off-by: Erwan Gouriou <[email protected]>
1 parent 06a4f1a commit de426f2

File tree

8 files changed

+166
-115
lines changed

8 files changed

+166
-115
lines changed

boards/st/stm32n6570_dk/board.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# Copyright (c) 2024 STMicroelectronics
33

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")
4+
if(CONFIG_STM32N6_BOOT_SERIAL)
5+
board_runner_args(stm32cubeprogrammer "--port=usb1")
6+
board_runner_args(stm32cubeprogrammer "--download-modifiers=0x1")
7+
board_runner_args(stm32cubeprogrammer "--start-modifiers=noack")
8+
else()
9+
board_runner_args(stm32cubeprogrammer "--port=swd")
10+
board_runner_args(stm32cubeprogrammer "--tool-opt= mode=HOTPLUG ap=1")
11+
board_runner_args(stm32cubeprogrammer "--extload=MX66UW1G45G_STM32N6570-DK.stldr")
12+
board_runner_args(stm32cubeprogrammer "--download-address=0x70000000")
13+
endif()
814

915
include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake)

boards/st/stm32n6570_dk/board.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ board:
44
vendor: st
55
socs:
66
- name: stm32n657xx
7+
variants:
8+
- name: sb
Lines changed: 2 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,13 @@
11
/*
2-
* Copyright (c) 2024 STMicroelectronics
2+
* Copyright (c) 2025 STMicroelectronics
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

77
/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>
8+
#include "stm32n6570_dk_common.dtsi"
119

1210
/ {
1311
model = "STMicroelectronics STM32N6570 Discovery Kit board";
1412
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";
10813
};

boards/st/stm32n6570_dk/stm32n6570_dk.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <st/n6/stm32n657X0.dtsi>
8+
#include <st/n6/stm32n657x0hxq-pinctrl.dtsi>
9+
#include <zephyr/dt-bindings/input/input-event-codes.h>
10+
11+
/ {
12+
chosen {
13+
zephyr,console = &usart1;
14+
zephyr,shell-uart = &usart1;
15+
zephyr,sram = &axisram2;
16+
};
17+
18+
aliases {
19+
led0 = &green_led_1;
20+
};
21+
22+
leds: leds {
23+
compatible = "gpio-leds";
24+
25+
green_led_1: led_1 {
26+
gpios = <&gpioo 1 GPIO_ACTIVE_HIGH>;
27+
label = "User LD1";
28+
};
29+
30+
red_led_1: led_2 {
31+
gpios = <&gpiog 10 GPIO_ACTIVE_HIGH>;
32+
label = "User LD2";
33+
};
34+
};
35+
};
36+
37+
&clk_hsi {
38+
hsi-div = <1>;
39+
status = "okay";
40+
};
41+
42+
&pll1 {
43+
clocks = <&clk_hsi>;
44+
div-m = <4>;
45+
mul-n = <75>;
46+
div-p1 = <1>;
47+
div-p2 = <1>;
48+
status = "okay";
49+
};
50+
51+
&ic1 {
52+
pll-src = <1>;
53+
ic-div = <2>;
54+
status = "okay";
55+
};
56+
57+
&ic2 {
58+
pll-src = <1>;
59+
ic-div = <3>;
60+
status = "okay";
61+
};
62+
63+
&ic6 {
64+
pll-src = <1>;
65+
ic-div = <2>;
66+
status = "okay";
67+
};
68+
69+
&ic11 {
70+
pll-src = <1>;
71+
ic-div = <3>;
72+
status = "okay";
73+
};
74+
75+
&perck {
76+
clocks = <&rcc STM32_SRC_HSI PER_SEL(0)>;
77+
status = "okay";
78+
};
79+
80+
&cpusw {
81+
clocks = <&rcc STM32_SRC_IC1 CPU_SEL(3)>;
82+
clock-frequency = <DT_FREQ_M(600)>;
83+
status = "okay";
84+
};
85+
86+
&rcc {
87+
/* ic2, ic6 & ic11 must all be enabled to set ic2 as SYSCLK */
88+
clocks = <&ic2>;
89+
clock-frequency = <DT_FREQ_M(400)>;
90+
ahb-prescaler = <2>;
91+
apb1-prescaler = <1>;
92+
apb2-prescaler = <1>;
93+
apb4-prescaler = <1>;
94+
apb5-prescaler = <1>;
95+
};
96+
97+
&usart1 {
98+
clocks = <&rcc STM32_CLOCK(APB2, 4)>,
99+
<&rcc STM32_SRC_CKPER USART1_SEL(1)>;
100+
pinctrl-0 = <&usart1_tx_pe5 &usart1_rx_pe6>;
101+
pinctrl-names = "default";
102+
current-speed = <115200>;
103+
status = "okay";
104+
};
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (c) 2025 STMicroelectronics
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
#include "stm32n6570_dk_common.dtsi"
9+
10+
/ {
11+
model = "STMicroelectronics STM32N6570 Discovery Kit board";
12+
compatible = "st,stm32n6570-dk-serial-boot";
13+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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
16+
17+
# Use serial boot (USB)
18+
CONFIG_STM32N6_BOOT_SERIAL=y

boards/st/stm32n6570_dk/twister.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: STM32N6570 Discovery Kit
2+
type: mcu
3+
arch: arm
4+
ram: 1024
5+
flash: 1024
6+
vendor: st
7+
supported:
8+
- gpio
9+
- uart
10+
variants:
11+
stm32n6570_dk/stm32n657xx:
12+
twister: false
13+
stm32n6570_dk/stm32n657xx/sb:
14+
toolchain:
15+
- zephyr
16+
- gnuarmemb
17+
- xtools

0 commit comments

Comments
 (0)