-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[bsp][renesas][ra4m1-ek] add a new bsp for ra4m1-ek board #10755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: bsp_renesasReviewers: kurisaW Changed Files (Click to expand)
🏷️ Tag: workflowReviewers: Rbb666 kurisaW supperthomas Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-10-09 15:37 CST)
📝 Review Instructions
|
There was a problem hiding this comment.
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 adds a new Board Support Package (BSP) for the Renesas RA4M1-EK evaluation board, introducing CMSIS 6 core header files and compiler-specific implementations for Cortex-M cores.
Key changes include:
- Addition of CMSIS 6 core header files for Cortex-M architecture support
- Compiler-specific implementations for IAR, GCC, Clang, and ARM Clang
- Core support files for SC000, CM1, and various Cortex-M profile implementations
- MPU, cache, PMU, and PAC extension support headers
Reviewed Changes
Copilot reviewed 57 out of 218 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
cmsis_iccarm_m.h | IAR compiler-specific CMSIS definitions and intrinsics for Cortex-M |
cmsis_gcc_m.h | GCC compiler-specific CMSIS definitions for Cortex-M |
cmsis_clang_m.h | Clang compiler-specific CMSIS definitions for Cortex-M |
cmsis_armclang_m.h | ARM Clang compiler-specific CMSIS definitions for Cortex-M |
armv8m_pmu.h | Performance Monitoring Unit support for ARMv8.1-M |
armv8m_mpu.h | Memory Protection Unit API for ARMv8-M and ARMv8.1-M |
armv81m_pac.h | Pointer Authentication Code functions for ARMv8.1-M |
armv7m_mpu.h | Memory Protection Unit API for ARMv7-M |
armv7m_cachel1.h | Level 1 Cache API for ARMv7-M and later |
core_sc000.h | CMSIS SC000 Core Peripheral Access Layer |
core_cm1.h | CMSIS Cortex-M1 Core Peripheral Access Layer |
#pragma language=extended | ||
__IAR_FT void __iar_uint16_write(void const *ptr, uint16_t val) | ||
{ | ||
*(__packed uint16_t*)(ptr) = val;; |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double semicolon should be single semicolon.
Copilot uses AI. Check for mistakes.
#pragma language=extended | ||
__IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) | ||
{ | ||
*(__packed uint32_t*)(ptr) = val;; |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double semicolon should be single semicolon.
*(__packed uint32_t*)(ptr) = val;; | |
*(__packed uint32_t*)(ptr) = val; |
Copilot uses AI. Check for mistakes.
#endif /* __ARM_ARCH_PROFILE == 'M' */ | ||
#endif | ||
|
||
/* Alternativ core deduction for older ICCARM's */ |
Copilot
AI
Sep 28, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in comment: 'Alternativ' should be 'Alternative'.
/* Alternativ core deduction for older ICCARM's */ | |
/* Alternative core deduction for older ICCARM's */ |
Copilot uses AI. Check for mistakes.
msg_ra = &can->callback_args->frame; | ||
#else | ||
msg_ra = can->callback_args->p_frame; | ||
#if defined(SOC_SERIES_R7FA4M1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里为什么要额外加个宏定义去配置?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为RA4M1的结构体类型是这个:msg_ra = &can->callback_args->frame,这个msg_ra = can->callback_args->p_frame会报错,MCU自带CAN为传统CAN
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那可能这块的逻辑之前是有问题的,这里不应该是can或canfd的判断,可能是FSP版本不同导致的,我看了一下fsp600版本的can和canfd驱动这里都是一样的,可以由:
#if defined(BSP_USING_CANFD)
msg_ra = &can->callback_args->frame;
#else
msg_ra = can->callback_args->p_frame;
#endif
修改为:
msg_ra = &can->callback_args->frame;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BSP_USING_CANFD直接用这个宏会报错,另外,去掉条件编译那以前的FSP版本怎么办
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不清楚fsp是哪个版本后被修改的,但是推荐用户使用最新版本fsp吧,毕竟有些更新是针对驱动库进行更新的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那可能这块的逻辑之前是有问题的,这里不应该是can或canfd的判断,可能是FSP版本不同导致的,我看了一下fsp600版本的can和canfd驱动这里都是一样的,可以由:
#if defined(BSP_USING_CANFD) msg_ra = &can->callback_args->frame; #else msg_ra = can->callback_args->p_frame; #endif修改为:
msg_ra = &can->callback_args->frame;
这样会引起别人的BSP编译出错
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
能举例是哪个吗,我这边看了ra6m3的350和510版本中对于此处定义都是msg_ra = &can->callback_args->frame;
,所以应该问题不大,估计之前就是有问题的,而且我看瑞萨对于can和canfd的驱动在此处成员的类型是不区分can/fdcan的,所以也不应该用BSP_USING_CANFD宏定义
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
重新看了一下,这里跟fsp版本,can/canfd并无关系,可以写成:
msg_ra = can->callback_args->p_frame;
也可以写成:
msg_ra = &can->callback_args->frame;
对于fsp中的描述p_frame指向的应该就是frame,所以两种写法都没毛病,只是说不应该用宏定义搞两套写法,选择修改为msg_ra = &can->callback_args->frame;
就好了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你看下源码吧,这块两个写法都是可以的,这不是兼不兼容的问题
bsp/renesas/ra4m1-ek/rtconfig.py
Outdated
OBJCPY = PREFIX + 'objcopy' | ||
NM = PREFIX + 'nm' | ||
|
||
DEVICE = ' -mcpu=cortex-m33 -mthumb -mfpu=fpv5-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面的cpu是m4,这里的编译参数是m33?
@@ -0,0 +1,178 @@ | |||
menu "Hardware Drivers Config" | |||
|
|||
config SOC_R7FA4M1AB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里请按照之前说的nano支持进行修改,群里有说明
msg_ra = can->callback_args->p_frame; 不是啊,这个写法编译有问题啊……
hywing.sir
***@***.***
…---Original---
From: "Yuqiang ***@***.***>
Date: Sun, Sep 28, 2025 18:34 PM
To: ***@***.***>;
Cc: ***@***.******@***.***>;
Subject: Re: [RT-Thread/rt-thread] [bsp][renesas][ra4m1-ek] add a new bsp forra4m1-ek board (PR #10755)
@kurisaW commented on this pull request.
In bsp/renesas/libraries/HAL_Drivers/drivers/drv_can.c:
> @@ -227,7 +227,11 @@ rt_ssize_t ra_can_recvmsg(struct rt_can_device *can_dev, void *buf, rt_uint32_t #if defined(BSP_USING_CANFD) msg_ra = &can->callback_args->frame; #else - msg_ra = can->callback_args->p_frame; + #if defined(SOC_SERIES_R7FA4M1)
你看下源码吧,这块两个写法都是可以的,这不是兼不兼容的问题
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
看了下600版本把 我看过510还有350这两个版本,都是支持p_frame和frame这两个成员的,估计后面瑞萨也认识到此处重复,所以我们保留frame就可以了 |
另外bsp fsp默认只保留一个串口用于控制台即可,其他的可以删掉,默认保持最小体量,你这边其他外设测试过后给个运行截图发到评论区就可以了 |
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
add a new bsp for ra4m1-ek board
你的解决方案是什么 (what is your solution)
add ra4m1 mcu bsp files
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 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