[bsp][n32] add H47X/H49X/H7XX driver support - #11711
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
e45f14c to
7fc58f3
Compare
There was a problem hiding this comment.
Pull request overview
Purpose / 目的:
This PR extends the N32 BSP (bsp/n32/n32hxxx) to support additional N32H47x/48x, N32H49x, and N32H7xx on-chip drivers (notably FDCAN/RTC/on-chip flash/SDMMC-related pieces) and updates related BSP project/configuration files.
本次 PR 扩展 N32 BSP(bsp/n32/n32hxxx),为 N32H47x/48x、N32H49x、N32H7xx 增加/完善片上驱动支持(重点包含 FDCAN/RTC/片上 Flash/SDMMC 相关内容),并同步更新 BSP 工程与配置文件。
Changes / 变更点:
- Add/extend on-chip flash drivers for N32H47x/48x and N32H49x (and related build integration).
新增/扩展 N32H47x/48x 与 N32H49x 的片上 Flash 驱动,并接入构建流程。 - Extend RTC/FDCAN configuration to support N32H47x/48x and N32H49x families.
扩展 RTC/FDCAN 配置以支持 N32H47x/48x 与 N32H49x 系列。 - Update BSP configs/projects and documentation tables to reflect newly supported features/boards.
更新 BSP 配置/工程文件与文档表格以反映新增支持。
Reviewed changes
Copilot reviewed 34 out of 61 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| bsp/README.md | Update N32 board capability matrix entries |
| bsp/n32/n32hxxx/n32h760zil7-stb/rtconfig.h | Add DFS-related macros (should be generated, not hand-edited) |
| bsp/n32/n32hxxx/n32h760zil7-stb/project.uvprojx | Adjust Keil defines/include paths; remove elmfat sources; misc cleanup |
| bsp/n32/n32hxxx/n32h760zil7-stb/board/ports/sd_host.h | Add SD host/card data structures (new header) |
| bsp/n32/n32hxxx/n32h760zil7-stb/board/Cube_Config/USER/src/n32h7xx_cfg.c | Cube-generated board init formatting/logic tweaks |
| bsp/n32/n32hxxx/n32h760zil7-stb/board/Cube_Config/USER/inc/n32h7xx_cfg.h | Adjust prototype formatting |
| bsp/n32/n32hxxx/n32h760zil7-stb/board/board.h | Formatting cleanup for memory/heap macros |
| bsp/n32/n32hxxx/n32h760zil7-stb/board/board.c | MPU config formatting cleanup |
| bsp/n32/n32hxxx/n32h760zil7-stb/.config | Enable DFS options and add additional BSP config symbols |
| bsp/n32/n32hxxx/n32h497zgl7-evb/project.uvprojx | Adjust Keil defines/include paths |
| bsp/n32/n32hxxx/n32h497zgl7-evb/project.uvoptx | Keil UI state change (tvExp) |
| bsp/n32/n32hxxx/n32h497zgl7-evb/board/Kconfig | Add on-chip flash/RTC/FDCAN Kconfig options |
| bsp/n32/n32hxxx/n32h497zgl7-evb/board/Cube_Config/USER/src/n32h49x_cfg.c | Cube-generated board init formatting/logic tweaks |
| bsp/n32/n32hxxx/n32h497zgl7-evb/board/Cube_Config/USER/inc/n32h49x_cfg.h | Adjust prototype formatting |
| bsp/n32/n32hxxx/n32h497zgl7-evb/.config | Add new BSP config symbols (flash/RTC/FDCAN) |
| bsp/n32/n32hxxx/n32h487zgl7-evb/project.uvprojx | Adjust Keil defines/include paths |
| bsp/n32/n32hxxx/n32h487zgl7-evb/board/Kconfig | Add on-chip flash/RTC/FDCAN Kconfig options |
| bsp/n32/n32hxxx/n32h487zgl7-evb/board/Cube_Config/USER/src/n32h47x_48x_cfg.c | Cube-generated board init formatting/logic tweaks + SHRTPLL helper |
| bsp/n32/n32hxxx/n32h487zgl7-evb/board/Cube_Config/USER/inc/n32h47x_48x_cfg.h | Adjust prototype formatting |
| bsp/n32/n32hxxx/n32h487zgl7-evb/.config | Add new BSP config symbols (flash/RTC/FDCAN) |
| bsp/n32/n32hxxx/libraries/N32_Drivers/nano/drv_gpio.h | Formatting cleanup for pin macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/nano/drv_console.c | Formatting cleanup in console init |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drv_common.h | Fix include indentation under RT_USING_DEVICE |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drv_common.c | Fix include indentation; add braces for clarity |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_spi.h | Formatting cleanup for DMA flags |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_sdmmc.h | Add SDMMC driver public header (new) |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_rtc.c | Extend RTC init/alarm handling across N32H7xx/H47x_48x/H49x |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_lptim.h | Formatting cleanup for enum constants |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_hard_i2c.h | Formatting cleanup; struct field alignment |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_gpio.h | Formatting cleanup for GET_PIN macro |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_flash/drv_flash_h49x.h | Add H49x on-chip flash driver API header (new) |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_flash/drv_flash_h49x.c | Add H49x on-chip flash driver implementation (new) |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_flash/drv_flash_h47x_48x.h | Add H47x/48x on-chip flash driver API header (new) |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_flash/drv_flash_h47x_48x.c | Add H47x/48x on-chip flash driver implementation (new) |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_fdcan.h | Extend FDCAN struct/config integration (add per-instance config pointer) |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_dma.h | Formatting cleanup for DMA config struct |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_config.h | Include per-series CAN config headers for H49x/H47x_48x |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_adc.c | Formatting cleanup; initialize locals; minor brace additions |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h7xx/tim_config.h | Formatting cleanup in timer config macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h7xx/spi_config.h | Formatting cleanup in SPI config macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h7xx/pwm_config.h | Formatting cleanup in PWM config macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h7xx/pulse_encoder_config.h | Formatting cleanup in pulse encoder macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h7xx/lptim_config.h | Formatting cleanup in LPTIM config macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h7xx/dac_config.h | Formatting cleanup in DAC config macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h7xx/can_config.h | Expand FDCAN instance resource configuration fields/macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h7xx/adc_config.h | Formatting cleanup in ADC config macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h49x/uart_config.h | Formatting cleanup in UART config macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h49x/can_config.h | Add H49x FDCAN config header (new) |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h47x_48x/uart_config.h | Formatting cleanup in UART config macros |
| bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/config/h47x_48x/can_config.h | Add H47x/48x FDCAN config header (new) |
Suppressed comments (1)
bsp/n32/n32hxxx/n32h760zil7-stb/board/ports/sd_host.h:130
- [naming/命名]: Typo/unclear member name
TMODE_truct/ 成员命名疑似拼写错误且不清晰TMODE_truct
English: TMODE_truct reads like a typo (missing 's' in 'struct') and is hard to read. Consider renaming to a clear, conventional member name.
中文:TMODE_truct 读起来像拼写错误(struct 少了 s),也不利于阅读。建议改成更清晰、符合习惯的成员名。
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| typedef enum | ||
| { | ||
| SDMMC_BusWdith1Bit = 0U, /* card bus 1 width */ | ||
| SDMMC_BusWdith4Bit = 1U, /* card bus 4 width */ | ||
| SDMMC_BusWdith8Bit = 2U, /* card bus 8 width */ | ||
| } sd_buswidth_t; |
There was a problem hiding this comment.
Thanks for the review. Fixed in bc3c928: renamed SDMMC_BusWdith* -> SDMMC_BusWidth*, sd_buswidth_t -> sd_bus_width_t, and TMODE_truct -> tMode in sd_host.h. The SDK driver library itself is left untouched, as it is vendor-provided code.
| #define RT_USING_DFS | ||
| #define DFS_USING_POSIX | ||
| #define DFS_USING_WORKDIR | ||
| #define DFS_FD_MAX 16 | ||
| #define RT_USING_DFS_V1 | ||
| #define DFS_FILESYSTEMS_MAX 4 | ||
| #define DFS_FILESYSTEM_TYPES_MAX 4 | ||
| #define RT_USING_DFS_DEVFS |
There was a problem hiding this comment.
Agreed. The hand-edited DFS macros in rtconfig.h were removed in bc3c928. DFS is now managed solely by the .config file (CONFIG_RT_USING_DFS=y etc.) and will be regenerated into rtconfig.h by scons, per RT-Thread convention.
| CONFIG_RT_USING_DFS=y | ||
| CONFIG_DFS_USING_POSIX=y | ||
| CONFIG_DFS_USING_WORKDIR=y | ||
| # CONFIG_RT_USING_DFS_MNTTABLE is not set | ||
| CONFIG_DFS_FD_MAX=16 | ||
| CONFIG_RT_USING_DFS_V1=y | ||
| # CONFIG_RT_USING_DFS_V2 is not set | ||
| CONFIG_DFS_FILESYSTEMS_MAX=4 | ||
| CONFIG_DFS_FILESYSTEM_TYPES_MAX=4 | ||
| # CONFIG_RT_USING_DFS_ELMFAT is not set | ||
| CONFIG_RT_USING_DFS_DEVFS=y |
There was a problem hiding this comment.
Fixed. The PR description has been updated to list the changed .config options (DFS/devfs for n32h760zil7-stb, on-chip flash/RTC/FDCAN for n32h487zgl7-evb and n32h497zgl7-evb) together with the verification steps (scons --menuconfig + scons -j).
- sd_host.h: fix BusWdith typo -> BusWidth, rename sd_buswidth_t, rename TMODE_truct -> tMode (avoid conflicting with SDK naming) - rtconfig.h (n32h760): remove hand-edited DFS macros, managed by .config - project.uvprojx (n32h487/n497/n760): drop local applications\test_file include-path reference (test dir is not part of the repository)
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
1、优化[bsp][n32]的drv_fdcan驱动
2、添加[bsp][n32]的drv_sdmmc驱动对N32H7XX系列支持
3、添加[bsp][n32]的on-chipflash驱动对N32H47X_48X和N32H49X系列支持
4、添加[bsp][n32]的drv_fdcan和dev_rtc驱动对N32H47X_48X和N32H49X系列支持
你的解决方案是什么 (what is your solution)
add H47X/H49X/H7XX driver support
请提供验证的bsp和config (provide the config and bsp)
bsp\n32\n32hxxx\n32h487zgl7-evb
bsp\n32\n32hxxx\n32h497zgl7-evb
bsp\n32\n32hxxx\n32h760zil7-stb
scons --menuconfig确认配置后scons -j编译即可]
当前拉取/合并请求的状态 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