[bsp][renesas][ra4m1-ek] add a new bsp for ra4m1-ek board#10755
[bsp][renesas][ra4m1-ek] add a new bsp for ra4m1-ek board#10755Rbb666 merged 9 commits intoRT-Thread:masterfrom
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-14 15:33 CST)
📝 Review Instructions
|
There was a problem hiding this comment.
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;; |
There was a problem hiding this comment.
Double semicolon should be single semicolon.
| #pragma language=extended | ||
| __IAR_FT void __iar_uint32_write(void const *ptr, uint32_t val) | ||
| { | ||
| *(__packed uint32_t*)(ptr) = val;; |
There was a problem hiding this comment.
Double semicolon should be single semicolon.
| *(__packed uint32_t*)(ptr) = val;; | |
| *(__packed uint32_t*)(ptr) = val; |
| #endif /* __ARM_ARCH_PROFILE == 'M' */ | ||
| #endif | ||
|
|
||
| /* Alternativ core deduction for older ICCARM's */ |
There was a problem hiding this comment.
Typo in comment: 'Alternativ' should be 'Alternative'.
| /* Alternativ core deduction for older ICCARM's */ | |
| /* Alternative core deduction for older ICCARM's */ |
| 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.
因为RA4M1的结构体类型是这个:msg_ra = &can->callback_args->frame,这个msg_ra = can->callback_args->p_frame会报错,MCU自带CAN为传统CAN
There was a problem hiding this comment.
那可能这块的逻辑之前是有问题的,这里不应该是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.
BSP_USING_CANFD直接用这个宏会报错,另外,去掉条件编译那以前的FSP版本怎么办
There was a problem hiding this comment.
这里不清楚fsp是哪个版本后被修改的,但是推荐用户使用最新版本fsp吧,毕竟有些更新是针对驱动库进行更新的
There was a problem hiding this comment.
那可能这块的逻辑之前是有问题的,这里不应该是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.
能举例是哪个吗,我这边看了ra6m3的350和510版本中对于此处定义都是msg_ra = &can->callback_args->frame;,所以应该问题不大,估计之前就是有问题的,而且我看瑞萨对于can和canfd的驱动在此处成员的类型是不区分can/fdcan的,所以也不应该用BSP_USING_CANFD宏定义
There was a problem hiding this comment.
重新看了一下,这里跟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;就好了
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' |
| @@ -0,0 +1,178 @@ | |||
| menu "Hardware Drivers Config" | |||
|
|
|||
| config SOC_R7FA4M1AB | |||
|
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