Skip to content

arch/arm/stm32n6: Add STM32N6 chip and Nucleo-N657X0-Q board support#18892

Merged
acassis merged 3 commits into
apache:masterfrom
ImBonkers:stm32n6-port
May 18, 2026
Merged

arch/arm/stm32n6: Add STM32N6 chip and Nucleo-N657X0-Q board support#18892
acassis merged 3 commits into
apache:masterfrom
ImBonkers:stm32n6-port

Conversation

@ImBonkers
Copy link
Copy Markdown
Contributor

Summary

  • Why: there is no STM32N6 support in tree. This PR adds support for STM32N6 family and the Nucleo-N657X0-Q development board.
  • What: new arch chip directory arch/arm/src/stm32n6 and new board directory boards/arm/stm32n6/nucleo-n657x0-q, plus chip and board documentation pages. Three commits:
  1. arch/arm/stm32n6: Add STM32N6 chip support.
  2. boards/arm/stm32n6/nucleo-n657x0-q: Add Nucleo-N657X0-Q board support.
  3. Documentation/platforms/arm: Add STM32N6 chip and Nucleo-N657X0-Q pages.
  • How: the chip boots to an NSH console over USART1 via the on-board ST-Link and runs in DEV boot mode. The scope of this PR does not cover MPU, I/D-cache, MVE (Helium), DMA-RX on serial, LPUART, USART2..5, RS-485, TrustZone Non-Secure world, or XSPI signed-flash boot, etc. DEV mode loads nuttx.bin directly to AXISRAM at 0x34000400. stm32_serial.c is a stripped down version of arch/arm/src/stm32h5/stm32_serial.c.
  • Related NuttX issue: none.
  • Related NuttX Apps issue / PR: none.

Impact

  • Is new feature added? Is existing feature changed? YES
    new chip family stm32n6 and new board nucleo-n657x0-q. No existing feature changed.

  • Impact on user (will user need to adapt to change)? NO

  • Impact on build (will build process change)? NO
    tools/ci/testlist/arm-14.dat already covers this chip via the /arm/stm32n* glob; CMake chip pickup via add_subdirectory(${NUTTX_CHIP_ABS_DIR}) works without changes to arch/arm/src/CMakeLists.txt.

  • Impact on hardware (will arch(s) / board(s) / driver(s) change)? YES
    new chip and new board. No sibling arch or board files modified.

  • Impact on documentation (is update required / provided)? YES
    new files: Documentation/platforms/arm/stm32n6/index.rst and Documentation/platforms/arm/stm32n6/boards/nucleo-n657x0-q/index.rst.

  • Impact on security (any sort of implications)? NO
    the chip runs in the Secure state with SAU in its reset configuration. No TrustZone Non-Secure programming and no RIF re-configuration.

  • Impact on compatibility (backward/forward/interoperability)? NO.

  • Anything else? The three commits each build on their own.

Testing

I confirm that changes are verified on local setup and works as intended:

  • Build Host: Ubuntu 24.04 x86_64, arm-none-eabi-gcc from the ghcr.io/apache/nuttx/apache-nuttx-ci-linux container image (latest tag as of this PR).

  • Target: STM Nucleo-N657X0-Q, flashed via the on-board ST-Link in DEV mode. Configs: nucleo-n657x0-q:nsh and nucleo-n657x0-q:ostest.

  • Reproduction steps:

    ./tools/configure.sh nucleo-n657x0-q:nsh   # or :ostest
    make
    # -w32 0xE000ED08 0x34000400 points VTOR at the loaded image
    STM32_Programmer_CLI -c port=SWD mode=UR -halt \
      -d nuttx.bin 0x34000400 \
      -w32 0xE000ED08 0x34000400 \
      -g 0x34000400

Testing logs:

$ ./tools/configure.sh nucleo-n657x0-q:nsh
$ make
...
Memory region         Used Size  Region Size  %age Used
            sram:       82812 B      4095 KB      1.97%
CP: nuttx.bin

$ ./tools/configure.sh nucleo-n657x0-q:ostest
$ make
...
Memory region         Used Size  Region Size  %age Used
            sram:      149116 B      4095 KB      3.56%
CP: nuttx.bin

--- Run 1: nsh ---

NuttShell (NSH) NuttX-12.13.0
nsh> uname -a
NuttX 12.13.0 f21a2c8f68 May 17 2026 20:04:10 arm nucleo-n657x0-q
nsh> uptime
00:00:04 up  0:00, load average: 0.00, 0.00, 0.00
nsh> uptime
00:00:14 up  0:00, load average: 0.00, 0.00, 0.00
nsh>
(10 second wall-clock equivalence)

--- Run 2: ostest ---

nsh> ostest
...
user_main: Exiting
ostest_main: Exiting with status 0
nsh>

All 31 ostest sub-tests pass.

--- CI parity (apache/nuttx-ci-linux container) ---

Build Attempt 1 of 4
====================================================================================
Configuration/Tool: nucleo-n657x0-q:nsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2026-05-17 18:28:52
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Building NuttX...
arm-none-eabi-ld: warning: /github/workspace/sources/nuttx/nuttx has a LOAD segment with RWX permissions
  [1/1] Normalize nucleo-n657x0-q:nsh
Build Attempt 1 of 4
====================================================================================
Configuration/Tool: nucleo-n657x0-q:ostest,CONFIG_ARM_TOOLCHAIN_GNU_EABI
2026-05-17 18:29:01
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Building NuttX...
arm-none-eabi-ld: warning: /github/workspace/sources/nuttx/nuttx has a LOAD segment with RWX permissions
  [1/1] Normalize nucleo-n657x0-q:ostest
====================================================================================

--- Lint ---

$ ./tools/checkpatch.sh -g HEAD~3..HEAD -> All checks pass
$ codespell                             -> clean on diff
$ cmake-format --check                  -> clean on new CMakeLists.txt

ImBonkers added 2 commits May 17, 2026 18:27
Introduce minimal chip support for the STMicro STM32N6 family
(Cortex-M55, ARMv8.1-M with TrustZone and FPU), sufficient to bring
up an NSH console over USART1.

Scope (deliberately minimal first drop):

  - Chip selector ARCH_CHIP_STM32N6 wired into arch/arm/Kconfig and
    chip-name mapping ("stm32n6").
  - Sub-Kconfig under arch/arm/src/stm32n6 with the STM32N657X0 chip
    selector and a single user-selectable USART (USART1).
  - Boot path: stm32_start with a naked dispatcher that clears the
    boot-ROM MSPLIM/PSPLIM stack limits before any compiler-emitted
    prologue, then runs vector relocation and SRAM-only heap init.
    The chip runs entirely in the Secure state; SAU is left in its
    reset configuration.
  - PLL1-based clock tree fed from HSI64 targeting 200 MHz CPU, with
    USART1 kernel-clock routed to HSI for a predictable BRR that is
    independent of any later clock change.
  - Low-level USART driver with full serial framework support.
    stm32_serial.c is adapted from arch/arm/src/stm32h5/stm32_serial.c
    (sibling ARMv8-M Mainline port with the same USART IP), stripped
    of DMA-RX, LPUART, the per-USART2..5 plumbing, RS-485 driver-enable,
    TIOCSINVERT/SWAP and HALFDUPLEX paths.
  - SysTick system timer.
  - GPIO, PWR and RCC helpers.

TrustZone, MPU, I/D-cache and Helium (MVE) are left disabled to
minimise bring-up surface; these will be added in follow-up patches
alongside the drivers that need them.

Signed-off-by: ImBonkers <samuelnlinden@pm.me>
Add board support for the STMicro Nucleo-N657X0-Q, sufficient to boot
NSH over the on-board ST-LINK virtual COM port (USART1, 115200 8N1)
in DEV (serial) boot mode.

Two defconfigs are shipped:

  - nsh:    minimal NuttShell prompt.
  - ostest: nsh + apps/testing/ostest for RTOS smoke testing.

Production signed XSPI flash boot is deferred to a follow-up; in DEV
mode the image is loaded directly into AXISRAM at 0x34000400 by the
host (e.g. STM32CubeProgrammer over ST-LINK), keeping the linker
script trivial — .text/.rodata/.data/.bss/.heap all in AXISRAM.

Signed-off-by: ImBonkers <samuelnlinden@pm.me>
@github-actions github-actions Bot added Area: Build system Arch: arm Issues related to ARM (32-bit) architecture Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm labels May 17, 2026
@linguini1
Copy link
Copy Markdown
Contributor

Awesome! Could you please attach the full OS Test logs?

@ImBonkers
Copy link
Copy Markdown
Contributor Author

Full ostest log attached.
ostest.log

Copy link
Copy Markdown
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me besides docs comment! Nice work!

@ImBonkers
Copy link
Copy Markdown
Contributor Author

Rewrote the docs, added a photo of the board.

@lupyuen
Copy link
Copy Markdown
Member

lupyuen commented May 18, 2026

@ImBonkers Could you squash these 2 commits into One Single Commit:

  • "Documentation/platforms/arm: Add STM32N6 chip and Nucleo-N657X0-Q pages."
  • "Documentation/platforms/arm/stm32n6: rework Nucleo-N657X0-Q board page against template, add board image."

And shorten the Commit Title to "Documentation/arm: Add STM32N6 and Nucleo-N657X0-Q"? Thanks :-) https://github.com/apache/nuttx/actions/runs/26004136077/job/76439720447#step:3:129

❌ Commit subject too long > 80
Used config files:
    1: .codespellrc
Some checks failed. For contributing guidelines, see:
  https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md

@xiaoxiang781216
Copy link
Copy Markdown
Contributor

@ImBonkers please fix https://github.com/apache/nuttx/actions/runs/26004136077/job/76439720447?pr=18892:

b2cb50a8f4 Merge ac77b38efc3f7a45799ef50548fcdbf6dd7d6920 into 702fd85acce62845f3e981caa3b833269babbea3
ac77b38efc Documentation/platforms/arm/stm32n6: rework Nucleo-N657X0-Q board page against template, add board image.
702fd85acc fs/vfs: enforce pseudoFS permissions on open()
f21a2c8f68 Documentation/platforms/arm: Add STM32N6 chip and Nucleo-N657X0-Q pages.
3f159db26a boards/arm/stm32n6/nucleo-n657x0-q: Add Nucleo-N657X0-Q board support.
266465f62a arch/arm/stm32n6: Add STM32N6 chip support.
../nuttx/tools/checkpatch.sh -c -u -m -g  3c05605079e9bacb38106bb996d8bde8933ca43e..HEAD
❌ Commit subject too long > 80
Used config files:
    1: .codespellrc
Some checks failed. For contributing guidelines, see:
  https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md
Error: Process completed with exit code 1.

Add documentation for the STMicro STM32N6 chip family and the
Nucleo-N657X0-Q development board introduced in the previous two
commits.

  - platforms/arm/stm32n6/index.rst
        Chip overview: core, peripherals supported in the initial
        port, and a pointer to the board page.

  - platforms/arm/stm32n6/boards/nucleo-n657x0-q/index.rst
        Board page, structured per Documentation/contributing/
        doc_templates/board.rst: hardware summary, user LED and
        button pin map, the two shipped configs (nsh, ostest),
        and the DEV-mode flash recipe used to load NuttX into
        AXISRAM via ST-LINK.

  - platforms/arm/stm32n6/boards/nucleo-n657x0-q/nucleo-n657x0-q.jpg
        Photograph of the board, referenced from the board page.

The pages are picked up by the existing glob-based toctree in
Documentation/platforms/arm/index.rst, no parent index changes are
required.

Signed-off-by: ImBonkers <samuelnlinden@pm.me>
@ImBonkers
Copy link
Copy Markdown
Contributor Author

Squashed into a single docs commit and shortened the title.

@acassis acassis merged commit f47e539 into apache:master May 18, 2026
51 of 80 checks passed
@acassis
Copy link
Copy Markdown
Contributor

acassis commented May 18, 2026

@ImBonkers Samuel, amazing first PR! Kudos!!!

@ImBonkers
Copy link
Copy Markdown
Contributor Author

Thank you all for the swift review!
I'll be sure to keep the quality up for future PRs :)

@ImBonkers ImBonkers deleted the stm32n6-port branch May 18, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Area: Build system Board: arm Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants