Skip to content

[bsp][stm32] add a new bsp for MCU STM32F407ZET6#11414

Open
hywing wants to merge 4 commits into
RT-Thread:masterfrom
hywing:stm32f407zet6
Open

[bsp][stm32] add a new bsp for MCU STM32F407ZET6#11414
hywing wants to merge 4 commits into
RT-Thread:masterfrom
hywing:stm32f407zet6

Conversation

@hywing
Copy link
Copy Markdown
Contributor

@hywing hywing commented May 26, 2026

拉取/合并请求描述:(PR description)

[

为什么提交这份PR (why to submit this PR)

add a new bsp for MCU STM32F407ZET6

你的解决方案是什么 (what is your solution)

add BSP files in directory bsp\stm32

请提供验证的bsp和config (provide the config and bsp)

  • BSP: bsp\stm32\stm32f407-industrial-board
  • .config:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@github-actions
Copy link
Copy Markdown

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  • 将目标分支设置为 \ Set the target branch to:stm32f407zet6
  • 设置PR number为 \ Set the PR number to:11414
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 stm32f407zet6 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the stm32f407zet6 branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions github-actions Bot added BSP: STM32 BSP related with ST/STM32 BSP action github action yml imporve labels May 26, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 26, 2026

📌 Code Review Assignment

🏷️ Tag: bsp_stm32

Reviewers: Liang1795 hamburger-os wdfk-prog

Changed Files (Click to expand)
  • bsp/stm32/stm32f407-industrial-board/.config
  • bsp/stm32/stm32f407-industrial-board/.gitignore
  • bsp/stm32/stm32f407-industrial-board/Kconfig
  • bsp/stm32/stm32f407-industrial-board/README.md
  • bsp/stm32/stm32f407-industrial-board/SConscript
  • bsp/stm32/stm32f407-industrial-board/SConstruct
  • bsp/stm32/stm32f407-industrial-board/applications/SConscript
  • bsp/stm32/stm32f407-industrial-board/applications/main.c
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/.mxproject
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/CubeMX_Config.ioc
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Inc/main.h
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Inc/stm32f4xx_it.h
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Src/main.c
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Src/stm32f4xx_it.c
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Src/system_stm32f4xx.c
  • bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/generate.script
  • bsp/stm32/stm32f407-industrial-board/board/Kconfig
  • bsp/stm32/stm32f407-industrial-board/board/SConscript
  • bsp/stm32/stm32f407-industrial-board/board/board.c
  • bsp/stm32/stm32f407-industrial-board/board/board.h
  • bsp/stm32/stm32f407-industrial-board/board/linker_scripts/link.icf
  • bsp/stm32/stm32f407-industrial-board/board/linker_scripts/link.lds
  • bsp/stm32/stm32f407-industrial-board/board/linker_scripts/link.sct
  • bsp/stm32/stm32f407-industrial-board/figures/board.jpg
  • bsp/stm32/stm32f407-industrial-board/project.ewd
  • bsp/stm32/stm32f407-industrial-board/project.ewp
  • bsp/stm32/stm32f407-industrial-board/project.eww

🏷️ Tag: workflow

Reviewers: Rbb666 kurisaW supperthomas

Changed Files (Click to expand)
  • .github/ALL_BSP_COMPILE.json

📊 Current Review Status (Last Updated: 2026-05-27 16:28 CST)

  • Liang1795 Pending Review
  • Rbb666 Pending Review
  • hamburger-os Pending Review
  • kurisaW Pending Review
  • supperthomas Pending Review
  • wdfk-prog Pending Review

📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new STM32 BSP (bsp/stm32/stm32f407-industrial-board) targeting STM32F407ZET6, including build/config files, board initialization, and IDE project templates, and registers the BSP in the CI compile list.
本次 PR 新增一个 STM32 BSP(bsp/stm32/stm32f407-industrial-board),面向 STM32F407ZET6,包含构建/配置文件、板级初始化与 IDE 工程模板,并将该 BSP 加入 CI 编译列表。

Changes / 变更:

  • Add new BSP directory with SCons/Kconfig/rtconfig and board bring-up + linker scripts. / 新增 BSP 目录,包含 SCons/Kconfig/rtconfig、板级初始化与链接脚本。
  • Add MDK/IAR project/template files and CubeMX configuration artifacts for the board. / 增加 MDK/IAR 工程与模板文件,以及 CubeMX 配置产物。
  • Register the BSP in .github/ALL_BSP_COMPILE.json for CI compilation. / 在 .github/ALL_BSP_COMPILE.json 中注册该 BSP 以便 CI 编译。

Reviewed changes

Copilot reviewed 40 out of 41 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.github/ALL_BSP_COMPILE.json Adds the new BSP path to the STM32 F2/F4 CI compile list.
bsp/stm32/stm32f407-industrial-board/.config Default BSP configuration used by Env/menuconfig.
bsp/stm32/stm32f407-industrial-board/.gitignore BSP-local ignore rules for build outputs and IDE artifacts.
bsp/stm32/stm32f407-industrial-board/Kconfig BSP-level Kconfig entry wiring RT-Thread/Kconfig, packages, and board Kconfig.
bsp/stm32/stm32f407-industrial-board/README.md Board/BSP usage guide and peripheral support notes.
bsp/stm32/stm32f407-industrial-board/SConscript Top-level SCons script to include subdirectories.
bsp/stm32/stm32f407-industrial-board/SConstruct SCons build entry for toolchain setup and package presence check.
bsp/stm32/stm32f407-industrial-board/rtconfig.h Generated RT-Thread configuration header for this BSP.
bsp/stm32/stm32f407-industrial-board/rtconfig.py Toolchain and build flags configuration for GCC/Keil/IAR.
bsp/stm32/stm32f407-industrial-board/applications/SConscript SCons rules for building application sources.
bsp/stm32/stm32f407-industrial-board/applications/main.c Sample app (LED blink + key IRQ demo).
bsp/stm32/stm32f407-industrial-board/board/SConscript SCons rules for board sources and CubeMX includes.
bsp/stm32/stm32f407-industrial-board/board/board.c Board clock configuration implementation.
bsp/stm32/stm32f407-industrial-board/board/board.h Board-level definitions (flash/heap bounds) and prototypes.
bsp/stm32/stm32f407-industrial-board/board/Kconfig Board driver options (GPIO/UART/etc.) and HAL driver Kconfig include.
bsp/stm32/stm32f407-industrial-board/board/linker_scripts/link.icf IAR linker configuration.
bsp/stm32/stm32f407-industrial-board/board/linker_scripts/link.lds GCC linker script for this BSP.
bsp/stm32/stm32f407-industrial-board/board/linker_scripts/link.sct Keil scatter file.
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/.mxproject CubeMX project metadata.
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/CubeMX_Config.ioc CubeMX IOC configuration for the board.
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/generate.script Script to generate code from CubeMX IOC.
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Inc/main.h CubeMX generated header.
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Inc/stm32f4xx_hal_conf.h CubeMX HAL configuration header.
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Inc/stm32f4xx_it.h CubeMX interrupt header.
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Src/main.c CubeMX generated main (reference artifact).
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Src/stm32f4xx_hal_msp.c CubeMX generated MSP init (pins/clocks).
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Src/stm32f4xx_it.c CubeMX generated ISR stubs.
bsp/stm32/stm32f407-industrial-board/board/CubeMX_Config/Src/system_stm32f4xx.c CubeMX generated CMSIS system file.
bsp/stm32/stm32f407-industrial-board/project.ewd IAR debug settings project file.
bsp/stm32/stm32f407-industrial-board/project.ewp IAR project file.
bsp/stm32/stm32f407-industrial-board/project.eww IAR workspace file.
bsp/stm32/stm32f407-industrial-board/project.uvoptx MDK5 uVision options file.
bsp/stm32/stm32f407-industrial-board/project.uvproj MDK4 uVision project file.
bsp/stm32/stm32f407-industrial-board/project.uvprojx MDK5 uVision project file.
bsp/stm32/stm32f407-industrial-board/template.ewp IAR template project file.
bsp/stm32/stm32f407-industrial-board/template.eww IAR template workspace file.
bsp/stm32/stm32f407-industrial-board/template.uvopt MDK4 template options file.
bsp/stm32/stm32f407-industrial-board/template.uvoptx MDK5 template options file.
bsp/stm32/stm32f407-industrial-board/template.uvproj MDK4 template project file.
bsp/stm32/stm32f407-industrial-board/template.uvprojx MDK5 template project file.
bsp/stm32/stm32f407-industrial-board/figures/board.jpg Board photo referenced by README.

Comment thread bsp/stm32/stm32f407-industrial-board/board/linker_scripts/link.lds
Comment on lines +65 to +69
/* KEY0: pull-down + rising edge; KEY1: pull-up + falling edge (active low) */
rt_pin_attach_irq(KEY0_PIN, PIN_IRQ_MODE_RISING, key0_irq_callback, RT_NULL);
rt_pin_attach_irq(KEY1_PIN, PIN_IRQ_MODE_FALLING, key1_irq_callback, RT_NULL);
rt_pin_irq_enable(KEY0_PIN, PIN_IRQ_ENABLE);
rt_pin_irq_enable(KEY1_PIN, PIN_IRQ_ENABLE);
Comment on lines +15 to +17
/* defined the LED1 pin: PC1 */
#define LED1_PIN GET_PIN(F, 10)
/* defined the LED2 pin: PC0 */
Comment on lines +15 to +21
<Device>STM32F407ZG</Device>
<Vendor>STMicroelectronics</Vendor>
<Cpu>IRAM(0x20000000-0x2001FFFF) IRAM2(0x10000000-0x1000FFFF) IROM(0x8000000-0x80FFFFF) CLOCK(25000000) CPUTYPE("Cortex-M4") FPU2</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile>"Startup\ST\STM32F4xx\startup_stm32f40_41xxx.s" ("STM32F40/41xxx Startup Code")</StartupFile>
<FlashDriverDll>UL2CM3(-O207 -S0 -C0 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024 -FS08000000 -FL0100000)</FlashDriverDll>
<DeviceId>6105</DeviceId>
Comment thread .github/ALL_BSP_COMPILE.json Outdated
"stm32/stm32f407-robomaster-c",
"stm32/stm32f407-st-discovery",
"stm32/stm32f407-micu",
"stm32/stm32f407-industrial-board",
Copy link
Copy Markdown
Contributor Author

@hywing hywing May 27, 2026

Choose a reason for hiding this comment

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

这个AI不太行,我用官方的format工具格式化了的
image

hywing and others added 3 commits May 27, 2026 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action github action yml imporve BSP: STM32 BSP related with ST/STM32 BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants