Skip to content

bsp/n32/n32hxxx上传Nsing LCDC和SDRAM的驱动 - #11682

Open
OnlyoutzZ wants to merge 6 commits into
RT-Thread:masterfrom
OnlyoutzZ:master
Open

bsp/n32/n32hxxx上传Nsing LCDC和SDRAM的驱动#11682
OnlyoutzZ wants to merge 6 commits into
RT-Thread:masterfrom
OnlyoutzZ:master

Conversation

@OnlyoutzZ

@OnlyoutzZ OnlyoutzZ commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

[

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

上传Nsing LCDC和SDRAM的驱动

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

补充完善Nsing LCDC和SDRAM的驱动

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

n32/n32h7xx/n32h760zil7-stb
n32/n32h7xx/n32h760zil7-stb/.config

  • BSP:
  • n32/n32h7xx/n32h760zil7-stb
  • .config:
  • action:

]

当前拉取/合并请求的状态 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
  • 已经使用clang-format 源码格式化工具确保格式符合RT-Thread代码规范 This PR has been formatted with clang-format and complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@github-actions

github-actions Bot commented Aug 3, 2026

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:master
  • 设置PR number为 \ Set the PR number to:11682
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 master 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the master 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 the BSP label Aug 3, 2026
@CYFS3

CYFS3 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

麻烦把标题完善一下比如[bsp][n32]:......

@OnlyoutzZ OnlyoutzZ changed the title 上传Nsing LCDC和SDRAM的驱动 bsp/n32/n32hxxx上传Nsing LCDC和SDRAM的驱动 Aug 4, 2026
@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

麻烦把标题完善一下比如[bsp][n32]:......

已经完善了

@CLAassistant

CLAassistant commented Aug 5, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

@CYFS3 你好,n32h7xx_std_drivern32h7xx_cmsis_driver仓库我更新了代码并提交了PR,麻烦有时间帮忙审核哈,谢谢

@OnlyoutzZ
OnlyoutzZ force-pushed the master branch 2 times, most recently from a3f3106 to 61fc28f Compare August 7, 2026 02:08
@CYFS3

CYFS3 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@CYFS3 你好,n32h7xx_std_drivern32h7xx_cmsis_driver仓库我更新了代码并提交了PR,麻烦有时间帮忙审核哈,谢谢

如果能提供运行的截图就更好了,然后下次格式化的话可以分开 commit,不然不好review

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

@CYFS3 你好,n32h7xx_std_drivern32h7xx_cmsis_driver仓库我更新了代码并提交了PR,麻烦有时间帮忙审核哈,谢谢

如果能提供运行的截图就更好了,然后下次格式化的话可以分开 commit,不然不好review

LCDC和QSPI的运行截图?另外以后修改单独的commit,代码格式化另外的commit,这样是吧?

@CYFS3

CYFS3 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

LCDC和QSPI的运行截图?

是的

另外以后修改单独的commit,代码格式化另外的commit,这样是吧?

对,不然review看到的东西太多了,不知道你修改了什么东西。

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

对,不然review看到的东西太多了,不知道你修改了什么东西。

那我这个PR要不要重新处理哈?让你好审核

@CYFS3

CYFS3 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

对,不然review看到的东西太多了,不知道你修改了什么东西。

那我这个PR要不要重新处理哈?让你好审核

可以的

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

对,不然review看到的东西太多了,不知道你修改了什么东西。

那我这个PR要不要重新处理哈?让你好审核

可以的

我重新处理了哈,没有完全剥离了,还是有点黏合在一起,但是现在比较清晰代码改动和格式化了,我后面的PR流程注意哈这个问题

Comment thread bsp/n32/n32hxxx/n32h760zil7-stb/board/Kconfig
Comment thread bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_qspi.c Outdated
@CYFS3

CYFS3 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

麻烦添加对应ci-attach看护起来

- Add LCDC driver (drv_lcd.c)
- Add SDRAM driver (drv_sdram.c) with port config (sdram_port.h)
- Add QSPI driver (drv_qspi.c/h)
- Update Kconfig for new peripheral options (QSPI, LCDC, SDRAM)
- Update Cube_Config and Keil project files
- Update bsp/README.md to list new driver support
- Add ci-attach build coverage for LCDC, SDRAM and QSPI
@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

麻烦添加对应ci-attach看护起来

已经添加了

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗?

@CYFS3

CYFS3 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗?

我没有明白你的意思-gun?可以把报错日志贴上来看看。

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗?

我没有明白你的意思-gun?

image bu'gou不勾这里编译报错,报错如下,union rt_sd_status中的结构体是无名的 image

@CYFS3

CYFS3 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗?

我没有明白你的意思-gun?

image bu'gou不勾这里编译报错,报错如下,union rt_sd_status中的结构体是无名的 image

这边先手动打开gnu的支持吧,后续我解决一下这个问题,应该是ac5不支持匿名结构体的问题

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗?

我没有明白你的意思-gun?

image bu'gou不勾这里编译报错,报错如下,union rt_sd_status中的结构体是无名的 image

这边先手动打开gnu的支持吧,后续我解决一下这个问题,应该是ac5不支持匿名结构体的问题

好的。有时间帮我审核哈n32h7xx_cmsis_drivern32h7xx_std_driver的PR,这个PR也帮忙处理哈,谢谢

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗?

我没有明白你的意思-gun?

image bu'gou不勾这里编译报错,报错如下,union rt_sd_status中的结构体是无名的 image

这边先手动打开gnu的支持吧,后续我解决一下这个问题,应该是ac5不支持匿名结构体的问题

好的。有时间帮我审核哈n32h7xx_cmsis_drivern32h7xx_std_driver的PR,这个PR也帮忙处理哈,谢谢

@CYFS3 能尽快帮忙处理哈吗

@CYFS3

CYFS3 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗?

我没有明白你的意思-gun?

image bu'gou不勾这里编译报错,报错如下,union rt_sd_status中的结构体是无名的 image

这边先手动打开gnu的支持吧,后续我解决一下这个问题,应该是ac5不支持匿名结构体的问题

上面这个问题 #11690 可以拉取这个pr测试看看

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗?

我没有明白你的意思-gun?

image bu'gou不勾这里编译报错,报错如下,union rt_sd_status中的结构体是无名的 image

这边先手动打开gnu的支持吧,后续我解决一下这个问题,应该是ac5不支持匿名结构体的问题

上面这个问题 #11690 可以拉取这个pr测试看看

我测试了#11690这个PR了,没问题

@OnlyoutzZ

Copy link
Copy Markdown
Contributor Author

@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗?

我没有明白你的意思-gun?

image bu'gou不勾这里编译报错,报错如下,union rt_sd_status中的结构体是无名的 image

这边先手动打开gnu的支持吧,后续我解决一下这个问题,应该是ac5不支持匿名结构体的问题

上面这个问题 #11690 可以拉取这个pr测试看看

有时间的话麻烦帮忙尽快审核哈这个PR,谢谢

@Rbb666 Rbb666 closed this Aug 12, 2026
@Rbb666 Rbb666 reopened this Aug 12, 2026
@Rbb666
Rbb666 requested review from Rbb666 and a lite review from Copilot August 12, 2026 02:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 extends the N32H760ZIL7-STB BSP (and related N32Hxxx driver layer) by adding new SDRAM/LCD/QSPI support pieces, plus updating Kconfig/CI configs and doing broad formatting cleanups across multiple N32 drivers.

Changes:

  • Add SDRAM port config + SDRAM driver, and add an LCDC-based LCD driver for N32H760ZIL7-STB.
  • Add a new XSPI/QSPI2 driver and corresponding BSP Kconfig/CI attachconfig entries.
  • Update bsp/README.md capability table and apply style/format adjustments across various N32 drivers.

Process / PR checklist notes (English / 中文):

  • PR title does not follow the required lowercase [module][subsystem] Description prefix style.
    PR 标题未遵循要求的小写 [模块][子系统] 描述 前缀格式。
  • PR description still contains the un-replaced template bracket block, which typically blocks merging.
    PR 描述仍保留了未替换/未移除的模板方括号内容,通常会阻塞合并。

Reviewed changes

Copilot reviewed 21 out of 30 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
bsp/README.md Update N32 BSP feature matrix (adds SDRAM/LCDC/QSPI columns).
bsp/n32/n32hxxx/n32h760zil7-stb/board/ports/sdram_port.h New board SDRAM parameter header.
bsp/n32/n32hxxx/n32h760zil7-stb/board/Kconfig Add SDRAM/LCD/QSPI Kconfig options for the BSP.
bsp/n32/n32hxxx/n32h760zil7-stb/board/Cube_Config/USER/src/n32h7xx_cfg.c Formatting/brace/style cleanup.
bsp/n32/n32hxxx/n32h760zil7-stb/board/Cube_Config/USER/inc/n32h7xx_cfg.h Formatting cleanup.
bsp/n32/n32hxxx/n32h760zil7-stb/.config Reflect new/renamed BSP Kconfig options.
bsp/n32/n32hxxx/n32h760zil7-stb/.ci/attachconfig/ci.attachconfig.yml Add CI build variants for lcd/sdram/qspi.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_wdt.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_usart.h Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_usart.c Formatting cleanup and minor logic formatting.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_tim.c Formatting cleanup and minor logic formatting.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_sdram.c New SDRAM driver + optional test command.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_sdio.h Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_sdio.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_qspi.h New XSPI/QSPI driver header.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_qspi.c New XSPI/QSPI2 bus/device implementation.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_pwm.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_pulse_encoder.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_nand.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_lptim.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_lcd.c New LCDC-based graphic device driver.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_gpio.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_flash/drv_flash_h7xx.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_fdcan.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_eth.c Formatting cleanup.
bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_dac.c Formatting cleanup.
Suppressed comments (1)

bsp/n32/n32hxxx/n32h760zil7-stb/board/Kconfig:122

  • [spelling/拼写]: Typo in prompt string: Heigh should be Height.

English: Fixing this improves menuconfig readability.
中文:提示字符串里 Heigh 拼写错误,应为 Height,修正后 menuconfig 更易读。

                int "LCD Vsync Heigh Pixel"

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread bsp/README.md Outdated
endchoice

config BSP_SDRAM_SIZE
int "SDARM Size (MBytes)"

menuconfig BSP_USING_LCD
bool "Enable ATK-MD0700R-800480, 5 inch screen, 800 * 480, RGB565 LCD"
select BSP_USING_LCDC
default 800

config BSP_LCD_HEIGHT_PIXEL
int "LCD Heigh Pixel"
Comment on lines +401 to +402
default n
endif
Comment on lines +58 to +61
static rt_err_t xspi_wait_busy(XSPI_Module *xspi, uint32_t timeout)
{
return xspi_wait_flag(xspi, XSPI_BUSY_FLAG, timeout);
}
Comment on lines +50 to +54
case RTGRAPHIC_CTRL_RECT_UPDATE:
{
rt_sem_take(&_lcd.lcd_lock, RT_TICK_PER_SECOND / 20);
LCDC_ReloadConfig(LCDC_VBRELOAD);
}
memset(&_lcd, 0x00, sizeof(_lcd));

/* init lcd_lock semaphore */
result = rt_sem_init(&_lcd.lcd_lock, "lcd_lock", 0, RT_IPC_FLAG_FIFO);
Comment on lines +8 to +12
* 2025-07-21 ox-horse first version for N32H760ZIL7-STB (W9825G6KH-6)
*/
/*
* SDRAM Chip: IS42S32800J
* 4 Banks x 2M words x 32 bits = 32 MB
Comment thread bsp/n32/n32hxxx/libraries/N32_Drivers/drivers/drv_sdram.c
@CYFS3

CYFS3 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@OnlyoutzZ 麻烦根据copilot的意见修改一下,然后把机器人的那笔commit刷掉,不然ci没有办法运行

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants