-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Add STM32N6 support #84128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kartben
merged 15 commits into
zephyrproject-rtos:main
from
gautierg-st:add_stm32n6_support
Jan 28, 2025
Merged
Add STM32N6 support #84128
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7890ef6
west.yml: update west.yml for stm32n6 hal
gautierg-st 0b663e4
modules: stm32: add stm32n6 cube modules
gautierg-st 7e14598
soc: st: stm32: add stm32n6 series
gautierg-st 90dc9af
soc: st: stm32: add a comment for kconfig source priority
gautierg-st 3767d91
dts: bindings: clock: add stm32n6 rcc clocks
gautierg-st 7d698c4
drivers: clock: add stm32n6 clock
gautierg-st 6bf10b7
drivers: pinctrl: stm32: add pinctrl for stm32n6
gautierg-st 83d717a
drivers: gpio: stm32: add support for stm32n6
gautierg-st b7d390f
include: zephyr: dt-bindings: reset: add stm32n6
gautierg-st 16a7db4
dts: arm: st: n6: add dtsi for stm32n6 series
gautierg-st 3cdd92e
soc: st: stm32: stm32n6x: add signing tool
gautierg-st 671b0bc
scripts: stm32cubeprogrammer: Add possibility to flash a bin file
gautierg-st 69c9705
boards: st: stm32n6570_dk: add support for stm32n6570_dk board
gautierg-st ec4fe41
boards: st: Add support for the nucleo_n657x0_q
erwango bd84fb8
dts: arm: st: n6: add all u(s)art instances
gautierg-st File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # STM32N657X0_Q Nucleo board configuration | ||
|
|
||
| # Copyright (c) 2024 STMicroelectronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config BOARD_NUCLEO_N657X0_Q | ||
| select SOC_STM32N657XX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright (c) 2024 STMicroelectronics | ||
|
|
||
| board_runner_args(stm32cubeprogrammer "--port=swd") | ||
| board_runner_args(stm32cubeprogrammer "--tool-opt= mode=HOTPLUG ap=1") | ||
| board_runner_args(stm32cubeprogrammer "--extload=MX25UM51245G_STM32N6570-NUCLEO.stldr") | ||
| board_runner_args(stm32cubeprogrammer "--download-address=0x70000000") | ||
|
|
||
| include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| board: | ||
| name: nucleo_n657x0_q | ||
| full_name: Nucleo N657x0-Q | ||
| vendor: st | ||
| socs: | ||
| - name: stm32n657xx | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,182 @@ | ||
| .. zephyr:board:: nucleo_n657x0_q | ||
|
|
||
| Overview | ||
| ******** | ||
|
|
||
| The STM32 Nucleo-144 board provides an affordable and flexible way for users to try out | ||
| new concepts and build prototypes by choosing from the various combinations of performance | ||
| and power consumption features, provided by the STM32 microcontroller. For the compatible boards, | ||
| the internal or external SMPS significantly reduces power consumption in Run mode. | ||
|
|
||
| The ST Zio connector, which extends the ARDUINO® Uno V3 connectivity, and the ST morpho headers | ||
| provide an easy means of expanding the functionality of the Nucleo open development platform with | ||
| a wide choice of specialized shields. | ||
|
|
||
| The STM32 Nucleo-144 board does not require any separate probe as it integrates the ST-LINK | ||
| debugger/programmer. | ||
|
|
||
| The STM32 Nucleo-144 board comes with the STM32 comprehensive free software libraries and | ||
| examples available with the STM32Cube MCU Package. | ||
|
|
||
| Hardware | ||
| ******** | ||
|
|
||
| - Common features: | ||
|
|
||
| - STM32 microcontroller in an LQFP144, TFBGA225, or VFBGA264 package | ||
| - 3 user LEDs | ||
| - 1 user push-button and 1 reset push-button | ||
| - 32.768 kHz crystal oscillator | ||
| - Board connectors: | ||
|
|
||
| - SWD | ||
| - ST morpho expansion connector | ||
|
|
||
| - Flexible power-supply options: ST-LINK USB VBUS, USB connector, or external sources | ||
|
|
||
| - Features specific to some of the boards (refer to the ordering information section | ||
| of the data brief for details); | ||
|
|
||
| - External or internal SMPS to generate Vcore logic supply | ||
| - Ethernet compliant with IEEE-802.3-2002 | ||
| - USB Device only, USB OTG full speed, or SNK/UFP (full-speed or high-speed mode) | ||
| - Board connectors: | ||
|
|
||
| - ARDUINO® Uno V3 connector or ST Zio expansion connector including ARDUINO® Uno V3 | ||
| - Camera module FPC | ||
| - MIPI20 compatible connector with trace signals | ||
| - USB with Micro-AB or USB Type-C® | ||
| - Ethernet RJ45 | ||
|
|
||
| - On-board ST-LINK (STLINK/V2-1, STLINK-V3E, or STLINK-V3EC) debugger/programmer with | ||
| USB re-enumeration capability: mass storage, Virtual COM port, and debug port | ||
|
|
||
| Supported Features | ||
| ================== | ||
|
|
||
| The Zephyr ``nucleo_n657x0_q`` board supports the following hardware features: | ||
|
|
||
| +-----------+------------+-------------------------------------+ | ||
| | Interface | Controller | Driver/Component | | ||
| +===========+============+=====================================+ | ||
| | CLOCK | on-chip | reset and clock control | | ||
| +-----------+------------+-------------------------------------+ | ||
| | GPIO | on-chip | gpio | | ||
| +-----------+------------+-------------------------------------+ | ||
| | NVIC | on-chip | nested vector interrupt controller | | ||
| +-----------+------------+-------------------------------------+ | ||
| | UART | on-chip | serial port-polling; | | ||
| | | | serial port-interrupt | | ||
| +-----------+------------+-------------------------------------+ | ||
|
|
||
|
|
||
| Other hardware features are not yet supported on this Zephyr port. | ||
|
|
||
| The default configuration can be found in the defconfig file: | ||
| :zephyr_file:`boards/st/nucleo_n657x0_q/nucleo_n657x0_q_defconfig` | ||
|
|
||
|
|
||
| Connections and IOs | ||
| =================== | ||
|
|
||
| NUCLEO_N657X0_Q Board has 12 GPIO controllers. These controllers are responsible | ||
| for pin muxing, input/output, pull-up, etc. | ||
|
|
||
| For more details please refer to `NUCLEO_N657X0_Q User Manual`_. | ||
|
|
||
| Default Zephyr Peripheral Mapping: | ||
| ---------------------------------- | ||
|
|
||
| - LD1 : PO1 | ||
| - LD2 : PG10 | ||
| - USART_1_TX : PE5 | ||
| - USART_1_RX : PE6 | ||
|
|
||
| System Clock | ||
| ------------ | ||
|
|
||
| NUCLEO_N657X0_Q System Clock could be driven by internal or external oscillator, | ||
| as well as main PLL clock. By default System clock is driven by PLL clock at | ||
| 400MHz, driven by 64MHz high speed internal oscillator. | ||
|
|
||
| Serial Port | ||
| ----------- | ||
|
|
||
| NUCLEO_N657X0_Q board has 10 U(S)ARTs. The Zephyr console output is assigned to | ||
| USART1. Default settings are 115200 8N1. | ||
|
|
||
| Programming and Debugging | ||
| ************************* | ||
|
|
||
| NUCLEO_N657X0_Q board includes an ST-LINK/V3 embedded debug tool interface. | ||
| This probe allows to flash the board using various tools. | ||
|
|
||
| Flashing | ||
| ======== | ||
|
|
||
| The board is configured to be flashed using west `STM32CubeProgrammer`_ runner, | ||
| so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required. | ||
erwango marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| Version 2.18.0 or later of `STM32CubeProgrammer`_ is required. | ||
|
|
||
| Flashing an application to NUCLEO_N657X0_Q | ||
| ------------------------------------------ | ||
|
|
||
| Connect the NUCLEO_N657X0_Q to your host computer using the USB port. | ||
| Then build and flash an application. | ||
|
|
||
| .. note:: | ||
| For flashing, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on | ||
| the board. | ||
|
|
||
| To run the application after flashing, BOOT1 should be set to 0 and the board | ||
| should be powered off and on again. | ||
|
|
||
| Here is an example for the :zephyr:code-sample:`hello_world` application. | ||
|
|
||
| Run a serial host program to connect with your Nucleo board: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ minicom -D /dev/ttyACM0 | ||
|
|
||
| Then build and flash the application. | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :zephyr-app: samples/hello_world | ||
| :board: nucleo_n657x0_q | ||
| :goals: build flash | ||
|
|
||
| You should see the following message on the console: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| Hello World! nucleo_n657x0_q/stm32n657xx | ||
|
|
||
| Debugging | ||
| ========= | ||
|
|
||
| For now debugging is only available through STM32CubeIDE: | ||
| * Go to File > Import and select C/C++ > STM32 Cortex-M Executable | ||
| * In Executable field, browse to your <ZEPHYR_PATH>/build/zephyr/zephyr.elf | ||
| * In MCU field, select STM32N657X0HxQ. | ||
| * Click on Finish | ||
| * Then click on Debug to start the debugging session | ||
|
|
||
| .. note:: | ||
| For debugging, BOOT0 pin should be set to 0 and BOOT1 to 1 before powering on the | ||
| board. | ||
|
|
||
| .. _NUCLEO_N657X0_Q website: | ||
| https://www.st.com/en/evaluation-tools/nucleo-n657x0-q.html | ||
|
|
||
| .. _NUCLEO_N657X0_Q User Manual: | ||
| https://www.st.com/resource/en/user_manual/um3417-stm32n6-nucleo144-board-mb1940-stmicroelectronics.pdf | ||
|
|
||
| .. _STM32N657X0 on www.st.com: | ||
| https://www.st.com/en/microcontrollers-microprocessors/stm32n657x0.html | ||
|
|
||
| .. _STM32N657 reference manual: | ||
| https://www.st.com/resource/en/reference_manual/rm0486-stm32n647657xx-armbased-32bit-mcus-stmicroelectronics.pdf | ||
|
|
||
| .. _STM32CubeProgrammer: | ||
| https://www.st.com/en/development-tools/stm32cubeprog.html | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| /* | ||
| * Copyright (c) 2024 STMicroelectronics | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /dts-v1/; | ||
| #include <st/n6/stm32n657X0.dtsi> | ||
| #include <st/n6/stm32n657x0hxq-pinctrl.dtsi> | ||
| #include <zephyr/dt-bindings/input/input-event-codes.h> | ||
|
|
||
| / { | ||
| model = "STMicroelectronics STM32N657X0-Q-NUCLEO board"; | ||
| compatible = "st,stm32n657x0-q-nucleo"; | ||
|
|
||
| chosen { | ||
| zephyr,console = &usart1; | ||
| zephyr,shell-uart = &usart1; | ||
| zephyr,sram = &axisram2; | ||
| }; | ||
|
|
||
| leds: leds { | ||
| compatible = "gpio-leds"; | ||
|
|
||
| green_led: led_1 { | ||
erwango marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| gpios = <&gpiog 0 GPIO_ACTIVE_HIGH>; | ||
| label = "User LD6"; | ||
| }; | ||
|
|
||
| blue_led: led_2 { | ||
| gpios = <&gpiog 8 GPIO_ACTIVE_HIGH>; | ||
| label = "User LD7"; | ||
| }; | ||
|
|
||
| red_led: led_3 { | ||
| gpios = <&gpiog 10 GPIO_ACTIVE_HIGH>; | ||
| label = "User LD5"; | ||
| }; | ||
| }; | ||
|
|
||
| gpio_keys { | ||
| compatible = "gpio-keys"; | ||
|
|
||
| user_button: button_0 { | ||
| gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>; | ||
| label = "User SB1"; | ||
| zephyr,code = <INPUT_KEY_0>; | ||
| }; | ||
| }; | ||
|
|
||
| aliases { | ||
| led0 = &green_led; | ||
| sw0 = &user_button; | ||
| }; | ||
| }; | ||
|
|
||
| &clk_hsi { | ||
| hsi-div = <1>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &pll1 { | ||
| clocks = <&clk_hsi>; | ||
| div-m = <4>; | ||
| mul-n = <75>; | ||
| div-p1 = <1>; | ||
| div-p2 = <1>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &ic1 { | ||
| pll-src = <1>; | ||
| ic-div = <2>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &ic2 { | ||
| pll-src = <1>; | ||
| ic-div = <3>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &ic6 { | ||
| pll-src = <1>; | ||
| ic-div = <2>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &ic11 { | ||
| pll-src = <1>; | ||
| ic-div = <3>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &perck { | ||
| clocks = <&rcc STM32_SRC_HSI PER_SEL(0)>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &cpusw { | ||
| clocks = <&rcc STM32_SRC_IC1 CPU_SEL(3)>; | ||
| clock-frequency = <DT_FREQ_M(600)>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| &rcc { | ||
| /* ic2, ic6 & ic11 must all be enabled to set ic2 as SYSCLK */ | ||
| clocks = <&ic2>; | ||
| clock-frequency = <DT_FREQ_M(400)>; | ||
| ahb-prescaler = <2>; | ||
| apb1-prescaler = <1>; | ||
| apb2-prescaler = <1>; | ||
| apb4-prescaler = <1>; | ||
| apb5-prescaler = <1>; | ||
| }; | ||
|
|
||
| &usart1 { | ||
| clocks = <&rcc STM32_CLOCK(APB2, 4)>, | ||
| <&rcc STM32_SRC_CKPER USART1_SEL(1)>; | ||
| pinctrl-0 = <&usart1_tx_pe5 &usart1_rx_pe6>; | ||
| pinctrl-names = "default"; | ||
| current-speed = <115200>; | ||
| status = "okay"; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| identifier: nucleo_n657x0_q | ||
| name: ST Nucleo N657X0-Q | ||
| type: mcu | ||
| arch: arm | ||
| toolchain: | ||
| - zephyr | ||
| - gnuarmemb | ||
| - xtools | ||
| ram: 1024 | ||
| flash: 0 | ||
| supported: | ||
| - gpio | ||
| - uart | ||
| vendor: st |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright (c) 2024 STMicroelectronics | ||
|
|
||
| # Enable UART driver | ||
| CONFIG_SERIAL=y | ||
|
|
||
| # Enable GPIO | ||
| CONFIG_GPIO=y | ||
|
|
||
| # Console | ||
| CONFIG_CONSOLE=y | ||
| CONFIG_UART_CONSOLE=y | ||
|
|
||
| # No internal Flash | ||
| CONFIG_XIP=n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Copyright (c) 2024 STMicroelectronics | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| config BOARD_STM32N6570_DK | ||
| select SOC_STM32N657XX |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # Copyright (c) 2024 STMicroelectronics | ||
|
|
||
| board_runner_args(stm32cubeprogrammer "--port=swd") | ||
| board_runner_args(stm32cubeprogrammer "--tool-opt= mode=HOTPLUG ap=1") | ||
| board_runner_args(stm32cubeprogrammer "--extload=MX66UW1G45G_STM32N6570-DK.stldr") | ||
| board_runner_args(stm32cubeprogrammer "--download-address=0x70000000") | ||
|
|
||
| include(${ZEPHYR_BASE}/boards/common/stm32cubeprogrammer.board.cmake) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| board: | ||
| name: stm32n6570_dk | ||
erwango marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| full_name: STM32N6570-DK | ||
| vendor: st | ||
| socs: | ||
| - name: stm32n657xx | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.