[bsp][stm32] Add stm32n657-st-nucleo BSP - #11799
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: bsp_stm32Reviewers: @Liang1795 @hamburger-os @wdfk-prog Changed Files (Click to expand)
🏷️ Tag: workflowReviewers: @Rbb666 @kurisaW @supperthomas Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-09-11 18:09 CST)
📝 Review Instructions
|
There was a problem hiding this comment.
🟡 Changes recommended
Build-breaking MPU, timer, DMA, and IAR configuration issues must be resolved before integration.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds STM32N657 Nucleo BSP support, toolchain projects, peripheral integration, and CI registration.
Changes:
- Adds board startup, linker, build, signing, and documentation assets.
- Extends shared STM32 GPIO, UART, DMA, timer, PWM, and SPI drivers for N6.
- Registers the BSP in CI and BSP indexes.
Metadata / 元数据: The title is valid, but the PR description still lacks solution, test board/configuration, and action results. / 标题格式正确,但 PR 描述仍缺少解决方案、测试板卡/配置及 Action 结果。
File summaries
| File | Description |
|---|---|
.github/ALL_BSP_COMPILE.json |
Registers BSP compilation |
bsp/README.md |
Adds BSP capability entry |
bsp/stm32/README.md |
Adds N6 board listing |
bsp/stm32/libraries/Kconfig |
Defines STM32N6 series |
tools/ci/bsp_detail.yml |
Adds BSP CI metadata |
tools/ci/toolchain_bsp.yml |
Adds GCC CI target |
bsp/stm32/stm32n657-st-nucleo/.config |
Provides default configuration |
bsp/stm32/stm32n657-st-nucleo/.gitignore |
Ignores build outputs |
bsp/stm32/stm32n657-st-nucleo/Kconfig |
Defines BSP configuration |
bsp/stm32/stm32n657-st-nucleo/SConstruct |
Configures SCons build |
bsp/stm32/stm32n657-st-nucleo/SConscript |
Collects BSP components |
bsp/stm32/stm32n657-st-nucleo/rtconfig.py |
Defines toolchain flags |
bsp/stm32/stm32n657-st-nucleo/rtconfig.h |
Provides generated configuration |
bsp/stm32/stm32n657-st-nucleo/README.md |
Documents BSP usage |
bsp/stm32/stm32n657-st-nucleo/README_zh.md |
Adds Chinese documentation |
bsp/stm32/stm32n657-st-nucleo/applications/main.c |
Adds LED example |
bsp/stm32/stm32n657-st-nucleo/applications/SConscript |
Builds applications |
bsp/stm32/stm32n657-st-nucleo/board/board.c |
Configures system clocks |
bsp/stm32/stm32n657-st-nucleo/board/board.h |
Defines board memory |
bsp/stm32/stm32n657-st-nucleo/board/Kconfig |
Exposes peripherals |
bsp/stm32/stm32n657-st-nucleo/board/SConscript |
Builds board sources |
bsp/stm32/stm32n657-st-nucleo/board/linker_scripts/link_app.ld |
Adds GCC APP layout |
bsp/stm32/stm32n657-st-nucleo/board/linker_scripts/link_app.sct |
Adds MDK APP layout |
bsp/stm32/stm32n657-st-nucleo/board/linker_scripts/link_fsbl.ld |
Adds GCC FSBL layout |
bsp/stm32/stm32n657-st-nucleo/board/linker_scripts/link_fsbl.sct |
Adds MDK FSBL layout |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/.mxproject |
Adds CubeMX metadata |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/CubeMX_Config.ioc |
Adds MCU configuration |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/Appli/Inc/main.h |
Adds application declarations |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/Appli/Inc/partition_stm32n657xx.h |
Defines TrustZone partition |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/Appli/Inc/stm32n6xx_hal_conf.h |
Configures N6 HAL |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/Appli/Inc/stm32n6xx_it.h |
Declares exception handlers |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/Appli/Src/secure_nsc.c |
Adds secure callbacks |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/Appli/Src/stm32n6xx_hal_msp.c |
Configures UART MSP |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/Appli/Src/stm32n6xx_it.c |
Adds exception handlers |
bsp/stm32/stm32n657-st-nucleo/board/CubeMX_Config/Secure_nsclib/secure_nsc.h |
Declares secure API |
bsp/stm32/stm32n657-st-nucleo/Signing_Programmer.bat |
Signs/programs APP |
bsp/stm32/stm32n657-st-nucleo/fsbl/Signing_Programmer.bat |
Signs/programs FSBL |
bsp/stm32/stm32n657-st-nucleo/build_app.bat |
Builds and signs APP |
bsp/stm32/stm32n657-st-nucleo/program_app.bat |
Programs APP image |
bsp/stm32/stm32n657-st-nucleo/setup_app.ini |
Configures MDK debugging |
bsp/stm32/stm32n657-st-nucleo/Project.uvmpw |
Adds MDK workspace |
bsp/stm32/stm32n657-st-nucleo/project.uvprojx |
Adds generated MDK project |
bsp/stm32/stm32n657-st-nucleo/project.uvoptx |
Adds MDK options |
bsp/stm32/stm32n657-st-nucleo/template.uvprojx |
Adds MDK template |
bsp/stm32/stm32n657-st-nucleo/template.uvoptx |
Adds MDK template options |
bsp/stm32/stm32n657-st-nucleo/project.ewp |
Adds generated IAR project |
bsp/stm32/stm32n657-st-nucleo/project.eww |
Adds IAR workspace |
bsp/stm32/stm32n657-st-nucleo/template.ewp |
Adds IAR template |
bsp/stm32/stm32n657-st-nucleo/template.eww |
Adds IAR template workspace |
bsp/stm32/stm32n657-st-nucleo/tools/STM32N6固件烧录工具.exe |
Adds programming binary |
bsp/stm32/stm32n657-st-nucleo/figures/board.jpg |
Adds board image |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911110923343.png |
Documents tool setup |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911110954590.png |
Documents tool setup |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911111014180.png |
Documents environment setup |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911111036134.png |
Documents loader location |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911111101078.png |
Documents loader setup |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911112015746.png |
Documents MDK workflow |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911112425301.png |
Documents MDK workflow |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911112556644.png |
Documents FSBL selection |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911113129450.png |
Illustrates FSBL boot |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911113257650.png |
Illustrates load-and-run |
bsp/stm32/stm32n657-st-nucleo/figures/image-20260911113738785.png |
Illustrates XiP boot |
bsp/stm32/libraries/HAL_Drivers/drv_common.c |
Adds MPU initialization |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_config.h |
Includes N6 configurations |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_dma.h |
Enables N6 GPDMA |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_gpio.c |
Adds N6 EXTI support |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_pwm.c |
Adds N6 timer clock support |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_spi.c |
Adds N6 SPI support |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_tim.c |
Adds N6 timer support |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart.c |
Adds N6 UART v1 support |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart.h |
Selects N6 UART API |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart_v2.c |
Adds N6 UART v2 support |
bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart_v2.h |
Selects N6 UART v2 API |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/adc_config.h |
Defines N6 ADC instances |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/dac_config.h |
Defines N6 DAC instances |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/dma_config.h |
Maps N6 GPDMA channels |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/lptim_config.h |
Defines N6 LPTIM instances |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/pwm_config.h |
Defines N6 PWM instances |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/qspi_config.h |
Defines QSPI configuration |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/sdio_config.h |
Defines SDIO configuration |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/spi_config.h |
Defines N6 SPI buses |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/tim_config.h |
Defines N6 TIM2 |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/uart_config.h |
Defines N6 UART instances |
bsp/stm32/libraries/HAL_Drivers/drivers/config/n6/usbd_config.h |
Defines N6 USB device |
Review details
Suppressed comments (4)
bsp/stm32/libraries/HAL_Drivers/drv_common.c:258
- [Bug/缺陷]: Scope the MPU implementation to supported BSPs / 将 MPU 实现限定到受支持的 BSP
English: drv_common.c is built for every STM32 BSP, but this unguarded function uses ARMv8-M-only HAL types and APIs. Non-N6 BSPs will still compile the body even though the call is guarded, causing build failures; guard both the declaration and definition with BSP_ENABLE_MPU (or an N6-specific condition).
中文:drv_common.c 会被所有 STM32 BSP 编译,但该函数未加保护且使用了仅适用于 ARMv8-M 的 HAL 类型和 API。即使调用处有条件保护,非 N6 BSP 仍会编译函数体并导致构建失败;请同时用 BSP_ENABLE_MPU(或 N6 专用条件)保护声明和定义。
bsp/stm32/libraries/HAL_Drivers/drv_common.c:270
- [Bug/缺陷]: Use linker symbols that actually exist / 使用实际存在的链接器符号
English: These identifiers are not declared or defined anywhere in the repository, while the new GCC scripts export __snoncacheable and __enoncacheable; enabling the default MPU option therefore cannot compile. Define compiler-specific section boundary symbols for GCC/MDK/IAR and pass a valid inclusive MPU limit.
中文:仓库中没有声明或定义这两个标识符,而新增的 GCC 链接脚本导出的是 __snoncacheable 和 __enoncacheable;因此启用默认 MPU 选项后无法编译。请为 GCC/MDK/IAR 定义对应的段边界符号,并向 MPU 传入有效的包含式结束地址。
bsp/stm32/libraries/HAL_Drivers/drivers/drv_tim.c:1074
- [Bug/缺陷]: N6 preprocessing never reaches this branch / N6 预处理无法到达此分支
English: The series dispatch immediately above has no SOC_SERIES_STM32N6 case, so an N6 build reaches #error "This driver has not supported this series yet!" before this code is compiled. Add N6 to that dispatch (with the appropriate APB classification) so enabling the advertised TIM2 support builds.
中文:上方的系列分派没有 SOC_SERIES_STM32N6 分支,因此 N6 构建在编译到这里之前就会触发 #error。请按正确的 APB 分类将 N6 加入该分派,使声明支持的 TIM2 配置能够构建。
#if defined(SOC_SERIES_STM32N6)
val = HAL_RCCEx_GetTIMGFreq() / freq;
#else
val = HAL_RCC_GetPCLK1Freq() * pclk1_doubler / freq;
#endif
bsp/stm32/stm32n657-st-nucleo/README.md:146
- [Documentation/文档]: IAR support is not usable yet / IAR 支持目前不可用
English: The IAR template still targets STM32H743ZI, the generated project uses the Cortex-M7 context file, and both rtconfig.py and the project reference a missing board/linker_scripts/link.icf. Remove the IAR support claim/CI flag for now, or add a complete STM32N657 IAR project and linker file.
中文:IAR 模板仍以 STM32H743ZI 为目标,生成工程使用 Cortex-M7 上下文文件,并且 rtconfig.py 与工程都引用了不存在的 board/linker_scripts/link.icf。请暂时移除 IAR 支持声明和 CI 标记,或补全 STM32N657 的 IAR 工程及链接文件。
- Files reviewed: 71/84 changed files
- Comments generated: 7
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| #define DMA1_Stream0_IRQn GPDMA1_Channel0_IRQn | ||
| #define DMA1_Stream1_IRQn GPDMA1_Channel1_IRQn | ||
| #define DMA1_Stream2_IRQn GPDMA1_Channel2_IRQn | ||
| #define DMA1_Stream3_IRQn GPDMA1_Channel3_IRQn | ||
| #define DMA1_Stream4_IRQn GPDMA1_Channel4_IRQn |
| config BSP_UART1_RX_USING_DMA | ||
| bool "Enable UART1 RX DMA" | ||
| depends on BSP_USING_UART1 && RT_SERIAL_USING_DMA | ||
| default n |
| #if defined (SOC_SERIES_STM32N6) | ||
| prescaler_value = HAL_RCCEx_GetTIMGFreq() / 1000 /1000; | ||
| #endif |
| config BSP_ENABLE_MPU | ||
| bool "Enable MPU" | ||
| default y |
| { | ||
| . = ALIGN(8); | ||
| __snoncacheable = .;/* create symbol for start of section */ | ||
| KEEP(*(noncacheable_buffer)) |
| | SPI | Supported | | | ||
| | PWM | Supported | | | ||
| | TIM | Supported | | |
| scons -j16 | ||
| ``` | ||
|
|
||
| The program can be downloaded using `tools\STM32N6固件烧录工具.exe`. |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
新增 stm32n657-st-nucleo BSP
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up