bsp/n32/n32hxxx上传Nsing LCDC和SDRAM的驱动 - #11682
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
|
麻烦把标题完善一下比如[bsp][n32]:...... |
已经完善了 |
|
@CYFS3 你好,n32h7xx_std_driver和n32h7xx_cmsis_driver仓库我更新了代码并提交了PR,麻烦有时间帮忙审核哈,谢谢 |
a3f3106 to
61fc28f
Compare
如果能提供运行的截图就更好了,然后下次格式化的话可以分开 commit,不然不好review |
LCDC和QSPI的运行截图?另外以后修改单独的commit,代码格式化另外的commit,这样是吧? |
是的
对,不然review看到的东西太多了,不知道你修改了什么东西。 |
那我这个PR要不要重新处理哈?让你好审核 |
可以的 |
我重新处理了哈,没有完全剥离了,还是有点黏合在一起,但是现在比较清晰代码改动和格式化了,我后面的PR流程注意哈这个问题 |
|
麻烦添加对应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
已经添加了 |
|
@CYFS3 请教一个问题,与本PR没关系,如果将Device Driver中的Using SD/MMC device drivers和Using Block device drivers选择后编译会报错,必须选择-gun,这是使用这两个驱动必须的条件吗? |
我没有明白你的意思-gun?可以把报错日志贴上来看看。 |
bu'gou不勾这里编译报错,报错如下,union rt_sd_status中的结构体是无名的
|
这边先手动打开gnu的支持吧,后续我解决一下这个问题,应该是ac5不支持匿名结构体的问题 |
好的。有时间帮我审核哈n32h7xx_cmsis_driver和n32h7xx_std_driver的PR,这个PR也帮忙处理哈,谢谢 |
@CYFS3 能尽快帮忙处理哈吗 |
There was a problem hiding this comment.
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.mdcapability 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] Descriptionprefix 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:
Heighshould beHeight.
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.
| 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" |
| default n | ||
| endif |
| static rt_err_t xspi_wait_busy(XSPI_Module *xspi, uint32_t timeout) | ||
| { | ||
| return xspi_wait_flag(xspi, XSPI_BUSY_FLAG, timeout); | ||
| } |
| 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); |
| * 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 |
|
@OnlyoutzZ 麻烦根据copilot的意见修改一下,然后把机器人的那笔commit刷掉,不然ci没有办法运行 |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>




拉取/合并请求描述:(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
无
]
当前拉取/合并请求的状态 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