Skip to content

Commit d37a365

Browse files
erwangokartben
authored andcommitted
boards: nucleo_n657x0_q: 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 de426f2 commit d37a365

File tree

8 files changed

+182
-131
lines changed

8 files changed

+182
-131
lines changed

boards/st/nucleo_n657x0_q/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=MX25UM51245G_STM32N6570-NUCLEO.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=MX25UM51245G_STM32N6570-NUCLEO.stldr")
12+
board_runner_args(stm32cubeprogrammer "--download-address=0x70000000")
13+
endif()
814

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

boards/st/nucleo_n657x0_q/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 & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,124 +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 "nucleo_n657x0_q_common.dtsi"
119

1210
/ {
1311
model = "STMicroelectronics STM32N657X0-Q-NUCLEO board";
1412
compatible = "st,stm32n657x0-q-nucleo";
15-
16-
chosen {
17-
zephyr,console = &usart1;
18-
zephyr,shell-uart = &usart1;
19-
zephyr,sram = &axisram2;
20-
};
21-
22-
leds: leds {
23-
compatible = "gpio-leds";
24-
25-
green_led: led_1 {
26-
gpios = <&gpiog 0 GPIO_ACTIVE_HIGH>;
27-
label = "User LD6";
28-
};
29-
30-
blue_led: led_2 {
31-
gpios = <&gpiog 8 GPIO_ACTIVE_HIGH>;
32-
label = "User LD7";
33-
};
34-
35-
red_led: led_3 {
36-
gpios = <&gpiog 10 GPIO_ACTIVE_HIGH>;
37-
label = "User LD5";
38-
};
39-
};
40-
41-
gpio_keys {
42-
compatible = "gpio-keys";
43-
44-
user_button: button_0 {
45-
gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
46-
label = "User SB1";
47-
zephyr,code = <INPUT_KEY_0>;
48-
};
49-
};
50-
51-
aliases {
52-
led0 = &green_led;
53-
sw0 = &user_button;
54-
};
55-
};
56-
57-
&clk_hsi {
58-
hsi-div = <1>;
59-
status = "okay";
60-
};
61-
62-
&pll1 {
63-
clocks = <&clk_hsi>;
64-
div-m = <4>;
65-
mul-n = <75>;
66-
div-p1 = <1>;
67-
div-p2 = <1>;
68-
status = "okay";
69-
};
70-
71-
&ic1 {
72-
pll-src = <1>;
73-
ic-div = <2>;
74-
status = "okay";
75-
};
76-
77-
&ic2 {
78-
pll-src = <1>;
79-
ic-div = <3>;
80-
status = "okay";
81-
};
82-
83-
&ic6 {
84-
pll-src = <1>;
85-
ic-div = <2>;
86-
status = "okay";
87-
};
88-
89-
&ic11 {
90-
pll-src = <1>;
91-
ic-div = <3>;
92-
status = "okay";
93-
};
94-
95-
&perck {
96-
clocks = <&rcc STM32_SRC_HSI PER_SEL(0)>;
97-
status = "okay";
98-
};
99-
100-
&cpusw {
101-
clocks = <&rcc STM32_SRC_IC1 CPU_SEL(3)>;
102-
clock-frequency = <DT_FREQ_M(600)>;
103-
status = "okay";
104-
};
105-
106-
&rcc {
107-
/* ic2, ic6 & ic11 must all be enabled to set ic2 as SYSCLK */
108-
clocks = <&ic2>;
109-
clock-frequency = <DT_FREQ_M(400)>;
110-
ahb-prescaler = <2>;
111-
apb1-prescaler = <1>;
112-
apb2-prescaler = <1>;
113-
apb4-prescaler = <1>;
114-
apb5-prescaler = <1>;
115-
};
116-
117-
&usart1 {
118-
clocks = <&rcc STM32_CLOCK(APB2, 4)>,
119-
<&rcc STM32_SRC_CKPER USART1_SEL(1)>;
120-
pinctrl-0 = <&usart1_tx_pe5 &usart1_rx_pe6>;
121-
pinctrl-names = "default";
122-
current-speed = <115200>;
123-
status = "okay";
12413
};

boards/st/nucleo_n657x0_q/nucleo_n657x0_q.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
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+
leds: leds {
19+
compatible = "gpio-leds";
20+
21+
green_led: led_1 {
22+
gpios = <&gpiog 0 GPIO_ACTIVE_HIGH>;
23+
label = "User LD6";
24+
};
25+
26+
blue_led: led_2 {
27+
gpios = <&gpiog 8 GPIO_ACTIVE_HIGH>;
28+
label = "User LD7";
29+
};
30+
31+
red_led: led_3 {
32+
gpios = <&gpiog 10 GPIO_ACTIVE_HIGH>;
33+
label = "User LD5";
34+
};
35+
};
36+
37+
gpio_keys {
38+
compatible = "gpio-keys";
39+
40+
user_button: button_0 {
41+
gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
42+
label = "User SB1";
43+
zephyr,code = <INPUT_KEY_0>;
44+
};
45+
};
46+
47+
aliases {
48+
led0 = &green_led;
49+
sw0 = &user_button;
50+
};
51+
};
52+
53+
&clk_hsi {
54+
hsi-div = <1>;
55+
status = "okay";
56+
};
57+
58+
&pll1 {
59+
clocks = <&clk_hsi>;
60+
div-m = <4>;
61+
mul-n = <75>;
62+
div-p1 = <1>;
63+
div-p2 = <1>;
64+
status = "okay";
65+
};
66+
67+
&ic1 {
68+
pll-src = <1>;
69+
ic-div = <2>;
70+
status = "okay";
71+
};
72+
73+
&ic2 {
74+
pll-src = <1>;
75+
ic-div = <3>;
76+
status = "okay";
77+
};
78+
79+
&ic6 {
80+
pll-src = <1>;
81+
ic-div = <2>;
82+
status = "okay";
83+
};
84+
85+
&ic11 {
86+
pll-src = <1>;
87+
ic-div = <3>;
88+
status = "okay";
89+
};
90+
91+
&perck {
92+
clocks = <&rcc STM32_SRC_HSI PER_SEL(0)>;
93+
status = "okay";
94+
};
95+
96+
&cpusw {
97+
clocks = <&rcc STM32_SRC_IC1 CPU_SEL(3)>;
98+
clock-frequency = <DT_FREQ_M(600)>;
99+
status = "okay";
100+
};
101+
102+
&rcc {
103+
/* ic2, ic6 & ic11 must all be enabled to set ic2 as SYSCLK */
104+
clocks = <&ic2>;
105+
clock-frequency = <DT_FREQ_M(400)>;
106+
ahb-prescaler = <2>;
107+
apb1-prescaler = <1>;
108+
apb2-prescaler = <1>;
109+
apb4-prescaler = <1>;
110+
apb5-prescaler = <1>;
111+
};
112+
113+
&usart1 {
114+
clocks = <&rcc STM32_CLOCK(APB2, 4)>,
115+
<&rcc STM32_SRC_CKPER USART1_SEL(1)>;
116+
pinctrl-0 = <&usart1_tx_pe5 &usart1_rx_pe6>;
117+
pinctrl-names = "default";
118+
current-speed = <115200>;
119+
status = "okay";
120+
};
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 "nucleo_n657x0_q_common.dtsi"
9+
10+
/ {
11+
model = "STMicroelectronics STM32N657X0-Q-NUCLEO board";
12+
compatible = "st,stm32n657x0-q-nucleo-sb";
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
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: ST Nucleo N657X0-Q
2+
type: mcu
3+
arch: arm
4+
ram: 1024
5+
flash: 1024
6+
supported:
7+
- gpio
8+
- uart
9+
vendor: st
10+
variants:
11+
nucleo_n657x0_q/stm32n657xx:
12+
twister: false
13+
nucleo_n657x0_q/stm32n657xx/sb:
14+
toolchain:
15+
- zephyr
16+
- gnuarmemb
17+
- xtools

0 commit comments

Comments
 (0)