Skip to content

[renesas][ra6w1]完善ra6w1的基础BSP驱动 - #11691

Merged
Rbb666 merged 1 commit into
RT-Thread:masterfrom
rcitach:rcitach/ra6w1_base
Aug 11, 2026
Merged

[renesas][ra6w1]完善ra6w1的基础BSP驱动#11691
Rbb666 merged 1 commit into
RT-Thread:masterfrom
rcitach:rcitach/ra6w1_base

Conversation

@rcitach

@rcitach rcitach commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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

[

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

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

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

  • BSP:
  • .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自查

@rcitach
rcitach requested review from Rbb666 and kurisaW as code owners August 10, 2026 07:43
@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:rcitach/ra6w1_base
  • 设置PR number为 \ Set the PR number to:11691
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 rcitach/ra6w1_base 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the rcitach/ra6w1_base 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 commented Aug 10, 2026

Copy link
Copy Markdown

📌 Code Review Assignment

🏷️ Tag: bsp_renesas

Reviewers: @kurisaW

Changed Files (Click to expand)
  • bsp/renesas/libraries/HAL_Drivers/drivers/config/drv_config.h
  • bsp/renesas/libraries/HAL_Drivers/drivers/config/raw/ra6w1/adc_config.h
  • bsp/renesas/libraries/HAL_Drivers/drivers/config/raw/ra6w1/uart_config.h
  • bsp/renesas/libraries/HAL_Drivers/drivers/drv_adc.c
  • bsp/renesas/libraries/HAL_Drivers/drivers/drv_i2c.c
  • bsp/renesas/libraries/HAL_Drivers/drivers/drv_rtc.c
  • bsp/renesas/libraries/HAL_Drivers/drivers/drv_spi.c
  • bsp/renesas/libraries/HAL_Drivers/drivers/drv_wdt.c
  • bsp/renesas/ra6w1-ek/.ci/attachconfig/attachconfig.yml
  • bsp/renesas/ra6w1-ek/.config
  • bsp/renesas/ra6w1-ek/board/Kconfig
  • bsp/renesas/ra6w1-ek/board/board.c
  • bsp/renesas/ra6w1-ek/board/board.h
  • bsp/renesas/ra6w1-ek/board/ports/SConscript
  • bsp/renesas/ra6w1-ek/board/ports/drv_gpio_w.c
  • bsp/renesas/ra6w1-ek/board/ports/drv_gpio_w.h
  • bsp/renesas/ra6w1-ek/board/ports/drv_pwm_w.c
  • bsp/renesas/ra6w1-ek/board/ports/drv_timer_w.c
  • bsp/renesas/ra6w1-ek/board/ports/fal_cfg.h
  • bsp/renesas/ra6w1-ek/board/ports/gpio_cfg.h
  • bsp/renesas/ra6w1-ek/board/ports/ra6w1_ospi_flash.c
  • bsp/renesas/ra6w1-ek/board/ports/ra6w1_qspi_psram.c
  • bsp/renesas/ra6w1-ek/ra/SConscript
  • bsp/renesas/ra6w1-ek/ra/fsp/inc/api/r_sdmmc_api.h
  • bsp/renesas/ra6w1-ek/ra/fsp/inc/instances/r_dmac_w.h
  • bsp/renesas/ra6w1-ek/ra/fsp/inc/instances/r_ospi_w.h
  • bsp/renesas/ra6w1-ek/ra/fsp/inc/instances/r_sdemmc_w.h
  • bsp/renesas/ra6w1-ek/ra/fsp/src/bsp_w/cmsis/Device/RENESAS/Source/system.c
  • bsp/renesas/ra6w1-ek/ra/fsp/src/r_adc_w/r_adc_w.c
  • bsp/renesas/ra6w1-ek/ra/fsp/src/r_dmac_w/r_dmac_w.c

📊 Current Review Status (Last Updated: 2026-08-11 09:41 CST)


📝 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.

@github-actions github-actions Bot added BSP BSP: Renesas BSP related with Renesas labels Aug 10, 2026
@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@rcitach rcitach changed the title 完善ra6w1的基础BSP驱动 [BSP][RA6W1]完善ra6w1的基础BSP驱动 Aug 10, 2026
@rcitach
rcitach force-pushed the rcitach/ra6w1_base branch 4 times, most recently from 6016c86 to 8f001c8 Compare August 10, 2026 09:36
@Rbb666
Rbb666 requested a lite review from Copilot August 10, 2026 09:37

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 enhances the Renesas RA6W1-EK BSP by expanding generated FSP integration and adding/adjusting RT-Thread driver glue for multiple peripherals (UART, GPIO/pinmux, SPI/I2C/ADC, TIM/PWM, QSPI PSRAM, OSPI flash, WDT/RTC), along with CI attachconfig presets.

本次 PR 主要完善 Renesas RA6W1-EK 的 BSP:扩展 FSP 生成/集成内容,并补齐/调整 RT-Thread 外设驱动适配(UART、GPIO/Pin、SPI/I2C/ADC、定时器/PWM、QSPI PSRAM、OSPI Flash、WDT/RTC)及 CI attachconfig 配置。

Changes:

  • Extend RA6W1 BSP Kconfig/options and generated HAL descriptors to cover more peripherals and pin configuration.
  • Add new port-layer drivers for TIM_W/PWM_W and external memories (QSPI PSRAM, OSPI flash + FAL integration).
  • Integrate additional FSP components (e.g., DMAC, SDMMC API headers/driver stubs) and update vector/pin/common data generation outputs.

Reviewed changes

Copilot reviewed 44 out of 45 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
bsp/renesas/ra6w1-ek/rtconfig.py Switch default build mode to debug.
bsp/renesas/ra6w1-ek/rtconfig.h Add UART0 pin string macros and extra section markers (generated file).
bsp/renesas/ra6w1-ek/rafw_gen/vector_data.h Rework IRQ vector macros/prototypes with RT config gating.
bsp/renesas/ra6w1-ek/rafw_gen/vector_data.c Populate vector table with multiple IRQ sources based on BSP options.
bsp/renesas/ra6w1-ek/rafw_gen/SConscript Simplify build script, adjust group name and include path.
bsp/renesas/ra6w1-ek/rafw_gen/pin_data.c Add dynamic pin config parsing/checking and pin table expansion.
bsp/renesas/ra6w1-ek/rafw_gen/hal_data.h Expand HAL externs/includes for many peripherals (SPI/QSPI/OSPI/I2C/ADC/TIM/RTC/WDT).
bsp/renesas/ra6w1-ek/rafw_gen/common_data.h Rename ioport instance exports and add IOPORT macro aliases.
bsp/renesas/ra6w1-ek/rafw_gen/common_data.c Rename/reshape ioport instance globals.
bsp/renesas/ra6w1-ek/rafw_gen/bsp_clock_cfg.h Change QSPI/peripheral clock source/dividers.
bsp/renesas/ra6w1-ek/rafw_cfg/fsp_cfg/r_sdemmc_w_cfg.h Add generated SDEMMC config header.
bsp/renesas/ra6w1-ek/rafw_cfg/fsp_cfg/r_dmac_w_cfg.h Add generated DMAC config header.
bsp/renesas/ra6w1-ek/ra/SConscript Add DMAC sources and fix TIM_W dependency key.
bsp/renesas/ra6w1-ek/ra/fsp/src/r_sdemmc_w/r_sdemmc_w_private.h Add large private header for SDEMMC driver.
bsp/renesas/ra6w1-ek/ra/fsp/src/r_dmac_w/r_dmac_w.c Add DMAC_W transfer implementation source.
bsp/renesas/ra6w1-ek/ra/fsp/src/r_adc_w/r_adc_w.c Fix include path for RA6W1 device definitions.
bsp/renesas/ra6w1-ek/ra/fsp/src/bsp_w/cmsis/Device/RENESAS/Source/system.c Call bsp_init(NULL) and adjust newlib stub conditional blocks.
bsp/renesas/ra6w1-ek/ra/fsp/inc/instances/r_sdemmc_w.h Add SDEMMC_W instance header.
bsp/renesas/ra6w1-ek/ra/fsp/inc/instances/r_ospi_w.h Fix include path for sdk_defs.h.
bsp/renesas/ra6w1-ek/ra/fsp/inc/instances/r_dmac_w.h Add DMAC_W instance header.
bsp/renesas/ra6w1-ek/ra/fsp/inc/api/r_sdmmc_api.h Add SDMMC API header.
bsp/renesas/ra6w1-ek/board/ports/SConscript Add conditional builds for timer/pwm/psram/ospi ports.
bsp/renesas/ra6w1-ek/board/ports/ra6w1_qspi_psram.c Add QSPI PSRAM init + optional memheap integration.
bsp/renesas/ra6w1-ek/board/ports/ra6w1_ospi_flash.c Add OSPI flash FAL flash device ops.
bsp/renesas/ra6w1-ek/board/ports/gpio_cfg.h Remove legacy GPIO IRQ mapping header.
bsp/renesas/ra6w1-ek/board/ports/fal_cfg.h Add RA6W1 FAL device/partition table glue.
bsp/renesas/ra6w1-ek/board/ports/drv_timer_w.c Add TIM_W clock timer driver registration.
bsp/renesas/ra6w1-ek/board/ports/drv_pwm_w.c Add PWM_W driver via TIM_W PWM mode.
bsp/renesas/ra6w1-ek/board/ports/drv_gpio_w.h Add GPIO_W pin driver header and pin-config init declaration.
bsp/renesas/ra6w1-ek/board/ports/drv_gpio_w.c Refactor pin driver init flow to use new ioport globals and pin-config init.
bsp/renesas/ra6w1-ek/board/Kconfig Add/expand peripheral Kconfig options (UART pins, SPI/I2C/ADC/TIM/PWM/OSPI/QSPI PSRAM, etc.).
bsp/renesas/ra6w1-ek/board/board.h Remove old GPIO/ioport alias macros from board header.
bsp/renesas/ra6w1-ek/board/board.c Add RT-Thread board init entry for this BSP (heap/pin/serial/components).
bsp/renesas/ra6w1-ek/.config Update default config with new options and section markers.
bsp/renesas/ra6w1-ek/.ci/attachconfig/attachconfig.yml Add CI attachconfig presets for various peripherals.
bsp/renesas/libraries/HAL_Drivers/drivers/drv_wdt.c Map WDT API to WDOG_W for RA6W1 and adjust logging format.
bsp/renesas/libraries/HAL_Drivers/drivers/drv_spi.c Add RA6W1 SPI_W mappings and refactor bitrate config handling.
bsp/renesas/libraries/HAL_Drivers/drivers/drv_rtc.c Map RTC API to RTC_W for RA6W1 and refactor time handling.
bsp/renesas/libraries/HAL_Drivers/drivers/drv_i2c.c Add RA6W1 I2C_MASTER_W mappings and refactor formatting.
bsp/renesas/libraries/HAL_Drivers/drivers/drv_adc.c Add RA6W1 ADC_W mappings and ADC ops extensions.
bsp/renesas/libraries/HAL_Drivers/drivers/config/raw/ra6w1/uart_config.h Fix UART instance mappings (uart0/1/2 -> g_uart0/1/2).
bsp/renesas/libraries/HAL_Drivers/drivers/config/raw/ra6w1/adc_config.h Add RA6W1 ADC raw config header.
bsp/renesas/libraries/HAL_Drivers/drivers/config/drv_config.h Include RA6W1 ADC raw config when enabled.
Suppressed comments (2)

bsp/renesas/ra6w1-ek/board/ports/ra6w1_ospi_flash.c:51

  • [bug/缺陷]: Bitwise OR is also used when reading the stashed tail from OSPI memory; use base + address.

English: Use OSPI_W_AUTOMODE_BASE_ADD + (addr + write_len) instead of OR to avoid addressing bugs.
中文:在从 OSPI 映射区读取“尾部暂存”数据时同样使用了按位或,建议改为 OSPI_W_AUTOMODE_BASE_ADD + (addr + write_len),避免地址计算错误。

            rt_memcpy(stash,
                      (const void *)((addr + write_len) | OSPI_W_AUTOMODE_BASE_ADD),
                      stash_len);

bsp/renesas/ra6w1-ek/board/ports/ra6w1_ospi_flash.c:121

  • [bug/缺陷]: Bitwise OR is also used when reading the stashed tail in erase; use base + address.

English: Use OSPI_W_AUTOMODE_BASE_ADD + (addr + erase_len) instead of OR.
中文:在擦除流程读取“尾部暂存”数据时也使用了按位或,建议改为 OSPI_W_AUTOMODE_BASE_ADD + (addr + erase_len)

            rt_memcpy(stash,
                      (const void *)((addr + erase_len) | OSPI_W_AUTOMODE_BASE_ADD),
                      stash_len);

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

Comment thread bsp/renesas/ra6w1-ek/board/Kconfig
Comment thread bsp/renesas/ra6w1-ek/rtconfig.h
Comment on lines +18 to +22
static int ra6w1_ospi_flash_read(long offset, rt_uint8_t *buf, rt_size_t size)
{
rt_memcpy((void *) buf, (void *) ((uint32_t)offset | OSPI_W_AUTOMODE_BASE_ADD), size);
return (int)size;
}
Comment on lines 236 to 240
/**< data_width : 1 -> 8 bits , 2 -> 16 bits, 4 -> 32 bits, default 32 bits*/
rt_uint8_t data_width = configuration->data_width / 8;
RT_ASSERT(data_width == 1 || data_width == 2 || data_width == 4);
configuration->data_width = configuration->data_width / 8;
spi_dev->rt_spi_cfg_t = configuration;
Comment thread bsp/renesas/ra6w1-ek/board/Kconfig
@rcitach rcitach changed the title [BSP][RA6W1]完善ra6w1的基础BSP驱动 [renesas][ra6w1]完善ra6w1的基础BSP驱动 Aug 11, 2026
@rcitach
rcitach force-pushed the rcitach/ra6w1_base branch from 8f001c8 to be79333 Compare August 11, 2026 01:41
@Rbb666
Rbb666 merged commit 5c76c21 into RT-Thread:master Aug 11, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BSP: Renesas BSP related with Renesas BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants