Skip to content

Conversation

@tomjielii
Copy link
Contributor

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

[

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

新增 瑞萨 EK-RA2E2的BSP支持,BSP需要FSP6.0.0版本
遗留的问题:
1.使用瑞萨的 RASC 生成驱动代码时,会重新在$(BSP_ROOT)目录下生成 bsp_linker_info.h,需要手动覆盖或删除
2.不支持 drv_i2c.c,RASC 没有生成 R_IIC_MASTER_Open 的选项,只有 R_IIC_b_MASTER_Open

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

  1. 增加脚本,每次编译前将新的bsp_linker_info.h 自动删除或覆盖
  2. drv_i2c.c 增加兼容性支持

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

  • BSP: bsp/renesas/ra2e2-ek
  • .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
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • [√ ] 如果是新增bsp, 已经添加ci检查到.github/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@CLAassistant
Copy link

CLAassistant commented Aug 29, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

github-actions bot commented Aug 29, 2025

📌 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/ra2e2/uart_config.h
  • bsp/renesas/libraries/Kconfig
  • bsp/renesas/ra2e2-ek/.api_xml
  • bsp/renesas/ra2e2-ek/.config
  • bsp/renesas/ra2e2-ek/.gitignore
  • bsp/renesas/ra2e2-ek/.ignore_format.yml
  • bsp/renesas/ra2e2-ek/.secure_azone
  • bsp/renesas/ra2e2-ek/.secure_rzone
  • bsp/renesas/ra2e2-ek/.secure_xml
  • bsp/renesas/ra2e2-ek/.settings/standalone.prefs
  • bsp/renesas/ra2e2-ek/Kconfig
  • bsp/renesas/ra2e2-ek/README.md
  • bsp/renesas/ra2e2-ek/SConscript
  • bsp/renesas/ra2e2-ek/SConstruct
  • bsp/renesas/ra2e2-ek/board/Kconfig
  • bsp/renesas/ra2e2-ek/board/SConscript
  • bsp/renesas/ra2e2-ek/board/board.h
  • bsp/renesas/ra2e2-ek/board/ports/SConscript
  • bsp/renesas/ra2e2-ek/board/ports/gpio_cfg.h
  • bsp/renesas/ra2e2-ek/buildinfo.gpdsc
  • bsp/renesas/ra2e2-ek/configuration.xml
  • bsp/renesas/ra2e2-ek/docs/picture/RASC.png
  • bsp/renesas/ra2e2-ek/docs/picture/Snipaste_2025-08-26_19-56-11.png
  • bsp/renesas/ra2e2-ek/docs/picture/ek-ra2e2-board-front.png
  • bsp/renesas/ra2e2-ek/docs/picture/jflash1.png
  • bsp/renesas/ra2e2-ek/docs/picture/jflash2.png
  • bsp/renesas/ra2e2-ek/docs/picture/readme_faq1.png
  • bsp/renesas/ra2e2-ek/fsp_gen.scat

🏷️ Tag: workflow

Reviewers: Rbb666 kurisaW supperthomas

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

📊 Current Review Status (Last Updated: 2025-09-02 21:09 CST)

  • Rbb666 Pending Review
  • kurisaW Pending Review
  • supperthomas 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.

@github-actions github-actions bot added BSP action github action yml imporve BSP: Renesas BSP related with Renesas labels Aug 29, 2025
@Rbb666 Rbb666 requested a review from kurisaW August 29, 2025 02:35
/*******************************************************************************************************************//**
* MCU starts executing here out of reset. Main stack pointer is set up already.
**********************************************************************************************************************/
void Reset_Handler (void)
Copy link
Member

Choose a reason for hiding this comment

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

此处建议修改为:

void Reset_Handler (void)
{
    /* Initialize system using BSP. */
    SystemInit();

    /* Call user application. */
#if defined(__GNUC__) && !defined(__ARMCC_VERSION)
    extern int entry(void);
    entry();
#elif defined(__ICCARM__)
    extern void __low_level_init(void);
    __low_level_init();
#else
	    /* Jump to main. */
    main();
#endif

    while (1)
    {
        /* Infinite Loop. */
    }
}

都统一一下

Export('SDK_LIB')

rtconfig.BSP_LIBRARY_TYPE = None

Copy link
Member

Choose a reason for hiding this comment

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

在这里可以加上这段逻辑:

def startup_check():
    import subprocess
    startup_check_path = os.getcwd() + "/../tools/startup_check.py"

    if os.path.exists(startup_check_path):
        try:
            subprocess.call(["python", startup_check_path])
        except:
            subprocess.call(["python3", startup_check_path])

RegisterPreBuildingAction(startup_check)

效果是如果使用内置的env编译之前会检查一下这个文件是否被修改,然后复原

@kurisaW
Copy link
Member

kurisaW commented Aug 29, 2025

另外IIC驱动命名问题,可以参考这段代码进行适配:

@supperthomas
Copy link
Member

bsp/renesas/ra2e2-ek/ra/arm/CMSIS_6/CMSIS/
CMSIS这里瑞萨不同bsp之间重复和比较大的文件比较多。看看后续如何优化一下,尽量用一份,或者试试看是否能用软件包之类的。这里建议先删除一些用不到的其他架构头文件,减少重复的code

@kurisaW
Copy link
Member

kurisaW commented Sep 3, 2025

bsp/renesas/ra2e2-ek/ra/arm/CMSIS_6/CMSIS/ CMSIS这里瑞萨不同bsp之间重复和比较大的文件比较多。看看后续如何优化一下,尽量用一份,或者试试看是否能用软件包之类的。这里建议先删除一些用不到的其他架构头文件,减少重复的code

@supperthomas 瑞萨的代码生成规范是这样的,包含CMSIS、启动文件、原厂驱动库,板级配置文件都是由configuration.xml统一生成的,并且按芯片家族统一,例如RA系列,后面可以考虑直接使用:https://github.com/renesas/fsp/tree/master/ra

只保留ra_gen和ra_cfg两个目录(具体bsp必要的),当然对应同一RA家族的fsp需要全部统一下同一版本的configuration.xml

这个后面我抽空单独起个PR吧,这个PR建议先不要动了

@kurisaW
Copy link
Member

kurisaW commented Sep 3, 2025

@tomjielii 我看这个板子只有8K RAM,这nano都跑不起来吧?有运行截图吗

@tomjielii
Copy link
Contributor Author

tomjielii commented Sep 3, 2025 via email

@kurisaW
Copy link
Member

kurisaW commented Sep 3, 2025

建议直接上nano,这个上完整版随便加点程序估计就没法跑了,只需要一键开启nano的宏定义就可以了,然后能关的内核选项都关了,本身板载驱动配置也可以保留着

@tomjielii
Copy link
Contributor Author

tomjielii commented Sep 3, 2025 via email

@supperthomas
Copy link
Member

https://club.rt-thread.org/ask/article/d273bbcd1f8779bc.html

ci.attachconfig.yml可以一下。

@supperthomas
Copy link
Member

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.
这个还没签

@tomjielii
Copy link
Contributor Author

tomjielii commented Sep 3, 2025 via email

@kurisaW
Copy link
Member

kurisaW commented Sep 3, 2025

再辛苦作者压缩一下提交哈,IIC驱动那块可以加个这个芯片的一个单独支持

@supperthomas
Copy link
Member

bsp/renesas/ra2e2-ek/ra/arm/CMSIS_6/CMSIS/ CMSIS这里瑞萨不同bsp之间重复和比较大的文件比较多。看看后续如何优化一下,尽量用一份,或者试试看是否能用软件包之类的。这里建议先删除一些用不到的其他架构头文件,减少重复的code

@supperthomas 瑞萨的代码生成规范是这样的,包含CMSIS、启动文件、原厂驱动库,板级配置文件都是由configuration.xml统一生成的,并且按芯片家族统一,例如RA系列,后面可以考虑直接使用:https://github.com/renesas/fsp/tree/master/ra

只保留ra_gen和ra_cfg两个目录(具体bsp必要的),当然对应同一RA家族的fsp需要全部统一下同一版本的configuration.xml

这个后面我抽空单独起个PR吧,这个PR建议先不要动了

image 这个PR已经5.5M了,还是建议用不到的文件删掉一些。

@tomjielii
Copy link
Contributor Author

tomjielii commented Sep 3, 2025 via email

@kurisaW
Copy link
Member

kurisaW commented Sep 3, 2025

IIC 这个模块,用宏名替换,但是不工作。 程廷桢 @.***

不工作是指什么意思?IIC没法正常驱动?

@tomjielii
Copy link
Contributor Author

tomjielii commented Sep 5, 2025 via email

@kurisaW
Copy link
Member

kurisaW commented Sep 8, 2025

基础bsp可以先提交上来,后面作者如果有空的话可以看看ra2e2的iic驱动问题,这个PR再rebase一下吧,如果无特别需要说明的,仅保留一条commit即可,我这边没问题了

@kurisaW
Copy link
Member

kurisaW commented Sep 8, 2025

LGTM

@Rbb666 Rbb666 merged commit 7d4efba into RT-Thread:master Sep 8, 2025
62 checks passed
@tomjielii
Copy link
Contributor Author

tomjielii commented Sep 9, 2025 via email

@kurisaW
Copy link
Member

kurisaW commented Sep 9, 2025

可以另起一个PR

@kurisaW kurisaW mentioned this pull request Sep 11, 2025
10 tasks
@Rbb666 Rbb666 added this to the v5.2.2 milestone Sep 23, 2025
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: Renesas BSP related with Renesas BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants