Skip to content

Commit 2039c6f

Browse files
unicornxtomjielii
authored andcommitted
doxygen: add howto for utest
After "utest: re-org utest framework (initial version)" (PR RT-Thread#10534) was merged, adding a document to introduce how to add utest-cases for your module. Signed-off-by: Chen Wang <unicorn_wang@outlook.com> [bsp][renesas] Porting Renesas BSP nano with one-click switching [bsp][renesas] modify MDK configuration [bsp][renesas] fixed a compile error and blink LED3 at 1Hz [bsp][renesas] update README.md [bsp][renesas] update gpio interrupt map table [bsp][renesas] update README.md
1 parent 591f8d2 commit 2039c6f

19 files changed

Lines changed: 145 additions & 1327 deletions

File tree

bsp/renesas/libraries/HAL_Drivers/config/ra2e2/uart_config.h renamed to bsp/renesas/libraries/HAL_Drivers/drivers/config/ra2e2/uart_config.h

File renamed without changes.

bsp/renesas/ra2e2-ek/.config

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
CONFIG_SOC_R7FA2E2A7=y
12

23
#
34
# RT-Thread Kernel
@@ -104,8 +105,6 @@
104105
#
105106
# CONFIG_RT_KLIBC_USING_USER_STRNLEN is not set
106107
# end of rt_strnlen options
107-
108-
# CONFIG_RT_UTEST_TC_USING_KLIBC is not set
109108
# end of klibc options
110109

111110
CONFIG_RT_NAME_MAX=8
@@ -1269,7 +1268,6 @@ CONFIG_SOC_SERIES_R7FA2E2=y
12691268
#
12701269
# Hardware Drivers Config
12711270
#
1272-
CONFIG_SOC_R7FA2E2A7=y
12731271

12741272
#
12751273
# Onboard Peripheral Drivers

bsp/renesas/ra2e2-ek/Kconfig

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,17 @@ PKGS_DIR := packages
1111

1212
ENV_DIR := /
1313

14+
config SOC_R7FA2E2A7
15+
bool
16+
select SOC_SERIES_R7FA2E2
17+
select RT_USING_COMPONENTS_INIT
18+
select RT_USING_USER_MAIN
19+
default y
20+
1421
source "$(RTT_DIR)/Kconfig"
1522
osource "$PKGS_DIR/Kconfig"
1623
rsource "../libraries/Kconfig"
17-
source "$(BSP_DIR)/board/Kconfig"
24+
25+
if !RT_USING_NANO
26+
rsource "$(BSP_DIR)/board/Kconfig"
27+
endif

bsp/renesas/ra2e2-ek/README.md

Lines changed: 38 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# 瑞萨 CPK-RA6M4 开发板 BSP 说明
1+
# 瑞萨 EK-RA2E2 开发板 BSP 说明
22

33
## 简介
44

5-
本文档为瑞萨 CPK-RA6M4 开发板提供的 BSP (板级支持包) 说明。通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。
5+
本文档为瑞萨 EK-RA2E2 开发板提供的 BSP (板级支持包) 说明。通过阅读快速上手章节开发者可以快速地上手该 BSP,将 RT-Thread 运行在开发板上。
66

77
主要内容如下:
88

@@ -11,15 +11,15 @@
1111

1212
## 开发板介绍
1313

14-
基于瑞萨 RA6M4 MCU 开发的 CPK-RA6M4 MCU 评估板,通过灵活配置软件包和 IDE,可帮助用户对 RA6M4 MCU 群组的特性轻松进行评估,并对嵌入系统应用程序进行开发。
14+
基于瑞萨 RA2E2 MCU 开发的 EK-RA2E2 MCU 评估板,通过灵活配置软件包和 IDE,可帮助用户对 RA2E2 MCU 群组的特性轻松进行评估,并对嵌入系统应用程序进行开发。
1515

1616
开发板正面外观如下图:
1717

18-
![image-20211011174017429](docs/picture/cpk-ra6m4.png)
18+
![EK-RA2E2 Evaluation Board](docs/picture/ek-ra2e2-board-front.png)
1919

2020
该开发板常用 **板载资源** 如下:
2121

22-
- MCU:R7FA6M4AF3CFB,200MHz,Arm Cortex®-M33 内核,1MB 代码闪存, 256kB SRAM
22+
- MCU:R7FA2E2A72DNK,48MHz,Arm Cortex®-M23 内核,64KB 代码闪存, 8kB SRAM
2323
- 调试接口:板载 J-Link 接口
2424
- 扩展接口:两个 PMOD 连接器
2525

@@ -31,23 +31,16 @@
3131

3232
| **片上外设** | **支持情况** | **备注** |
3333
| :----------------- | :----------------- | :------------- |
34-
| UART | 支持 | UART7 为默认日志输出端口 |
34+
| UART | 支持 | UART9 为默认日志输出端口 |
3535
| GPIO | 支持 | |
3636
| IIC | 支持 | 软件 |
3737
| WDT | 支持 | |
3838
| RTC | 支持 | |
3939
| ADC | 支持 | |
40-
| DAC | 支持 | |
4140
| SPI | 支持 | |
4241
| FLASH | 支持 | |
4342
| PWM | 支持 | |
44-
| CAN | 支持 | |
4543
| 持续更新中... | | |
46-
| **外接外设** | **支持情况** | **备注** |
47-
| WiFi 模块 | 支持 | [RW007 WiFi 网络模块](https://github.com/RT-Thread-packages/rw007) |
48-
| 温湿度传感器 | 支持 | [HS300x 温湿度模块](https://github.com/Guozhanxin/hs300x) |
49-
| 室内空气质量传感器 | 支持 | [zmod4410 室内空气质量模块](https://github.com/ShermanShao/zmod4410) |
50-
| 光线传感器 | 支持 | [isl29035光线传感器模块](https://github.com/ShermanShao/isl29035) |
5144

5245

5346
## 使用说明
@@ -67,23 +60,21 @@
6760

6861
**硬件连接**
6962

70-
使用 USB 数据线连接开发板到 PC,使用 J-link 接口下载和 DEBUG 程序。使用 USB 转串口工具连接 UART7:P613(TXD)、P614(RXD)。
63+
使用 USB 数据线连接开发板到 PC,使用 J-link 接口下载和 DEBUG 程序。使用 USB 转串口工具连接 UART9:P101(TXD)、P100(RXD)。
64+
65+
![UART9 接线](docs/picture/Snipaste_2025-08-26_19-56-11.png)
7166

7267
**编译下载**
7368

7469
- 编译:双击 project.uvprojx 文件,打开 MDK5 工程,编译程序。
7570

76-
> 注意:此工程需要使用 J-Flash Lite 工具烧录程序。建议使用 V7.50 及以上版本烧录工程。[J-Link 下载链接](https://www.segger.com/downloads/jlink/)
77-
78-
- 下载:打开 J-Flash lite 工具,选择芯片型号 R7FA6M4AF,点击 OK 进入工具。选择 BSP 目录下 MDK 编译出的 /object/ra6m4.hex 文件,点击 Program Device 按钮开始烧录。具体操作过程可参考下图步骤:
79-
80-
![image-20211011181555421](docs/picture/jflash1.png)
71+
> 注意:此工程需要使用 J-Flash Lite 工具烧录程序。建议使用 V7.70 及以上版本烧录工程。[J-Link 下载链接](https://www.segger.com/downloads/jlink/)
8172
82-
![image-20211011182047981](docs/picture/jflash2.png)
73+
- 下载:打开 J-Flash lite 工具,选择芯片型号 R7FA2E2A7,点击 OK 进入工具。选择 BSP 目录下 MDK 编译出的 /object/rtthread.hex 文件,点击 Program Device 按钮开始烧录。具体操作过程可参考下图步骤:
8374

84-
![image-20211011182434519](docs/picture/jflash.png)
75+
![jflash1](docs/picture/jflash1.png)
8576

86-
![image-20211011182949604](docs/picture/jflash3.png)
77+
![jflash2](docs/picture/jflash2.png)
8778

8879
**查看运行结果**
8980

@@ -94,38 +85,33 @@
9485
```bash
9586
\ | /
9687
- RT - Thread Operating System
97-
/ | \ 4.0.4 build Oct 11 2021
98-
2006 - 2021 Copyright by rt-thread team
88+
/ | \ 5.2.2 build Aug 26 2025 19:23:38
89+
2006 - 2024 Copyright by rt-thread team
9990

10091
Hello RT-Thread!
10192
msh >
10293
msh >help
10394
RT-Thread shell commands:
95+
pin - pin [option]
10496
reboot - Reboot System
105-
help - RT - Thread shell help.
106-
ps - List threads in the system.
107-
free - Show the memory usage in the system.
108-
hello - say hello world
97+
help - RT-Thread shell help
98+
ps - List threads in the system
99+
free - Show the memory usage in the system
109100
clear - clear the terminal screen
110-
version - show RT - Thread version information
111-
list_thread - list thread
112-
list_sem - list semaphore in system
113-
list_event - list event in system
114-
list_mutex - list mutex in system
115-
list_mailbox - list mail box in system
116-
list_msgqueue - list message queue in system
117-
list_timer - list timer in system
118-
list_device - list device in system
119-
list - list all commands in system
101+
version - show RT-Thread version information
102+
list - list objects
103+
backtrace - print backtrace of a thread
120104

121105
msh >
122106
```
123107

124108
**应用入口函数**
125109

126-
应用层的入口函数在 **bsp\ra6m4-cpk\src\hal_emtry.c** 中 的 `void hal_entry(void)` 。用户编写的源文件可直接放在 src 目录下。
110+
应用层的入口函数在 **bsp\ra2e2-ek\src\hal_emtry.c** 中 的 `void hal_entry(void)` 。用户编写的源文件可直接放在 src 目录下。
127111

128112
```c
113+
#define LED3_PIN BSP_IO_PORT_00_PIN_15 /* Onboard LED pins */
114+
129115
void hal_entry(void)
130116
{
131117
rt_kprintf("\nHello RT-Thread!\n");
@@ -144,39 +130,37 @@ void hal_entry(void)
144130
145131
**资料及文档**
146132
147-
- [开发板官网主页](https://www2.renesas.cn/cn/zh/products/microcontrollers-microprocessors/ra-cortex-m-mcus/cpk-ra6m4-evaluation-board)
148-
- [开发板用户手册](https://www2.renesas.cn/cn/zh/document/mah/1527156?language=zh&r=1527191)
149-
- [瑞萨RA MCU 基础知识](https://www2.renesas.cn/cn/zh/document/gde/1520091)
150-
- [RA6 MCU 快速设计指南](https://www2.renesas.cn/cn/zh/document/apn/ra6-quick-design-guide)
151-
- [RA6M4_datasheet](https://www2.renesas.cn/cn/zh/document/dst/ra6m4-group-datasheet)
152-
- [RA6M4 Group User’s Manual: Hardware](https://www2.renesas.cn/cn/zh/document/man/ra6m4-group-user-s-manual-hardware)
133+
- [芯片官网主页](https://www.renesas.cn/zh/products/ra2e2)
134+
- [开发板官网主页](https://www.renesas.cn/zh/design-resources/boards-kits/ek-ra2e2)
135+
- [开发文档](https://www.renesas.cn/zh/design-resources/boards-kits/ek-ra2e2#documents)
153136
154137
**FSP 配置**
155138
156-
需要修改瑞萨的 BSP 外设配置或添加新的外设端口,需要用到瑞萨的 [FSP](https://www2.renesas.cn/jp/zh/software-tool/flexible-software-package-fsp#document) 配置工具。请务必按照如下步骤完成配置。配置中有任何问题可到[RT-Thread 社区论坛](https://club.rt-thread.org/)中提问。
139+
需要修改瑞萨的 BSP 外设配置或添加新的外设端口,需要用到瑞萨的 [FSP](https://www.renesas.cn/zh/software-tool/flexible-software-package-fsp#overview) 配置工具。请务必按照如下步骤完成配置。配置中有任何问题可到[RT-Thread 社区论坛](https://club.rt-thread.org/)中提问。
140+
141+
1. [下载灵活配置软件包 (FSP) | Renesas](https://www.renesas.cn/zh/software-tool/flexible-software-package-fsp#overview),请使用 FSP 6.0.0 版本
142+
2. 下载对应操作系统的 FSP RASC
143+
3. 新建工程
144+
4. [使用瑞萨 FSP 配置工具](./docs/picture/RASC.png)。如果使用 scons 进行开发,在 IDE Project Type 选择CMAKE;如果使用MDK开发,则选择KEIL MDK。
157145
158-
1. [下载灵活配置软件包 (FSP) | Renesas](https://www.renesas.com/cn/zh/software-tool/flexible-software-package-fsp),请使用 FSP 3.5.0 版本
159-
2. 下载安装完成后,需要添加 CPK-RA6M4 开发板的官方板级支持包
160-
> 打开[ CPK-RA6M4 开发板详情页](https://www2.renesas.cn/jp/zh/products/microcontrollers-microprocessors/ra-cortex-m-mcus/cpk-ra6m4-evaluation-board),在**“下载”**列表中找到 **”CPK-RA6M4板级支持包“**,点击链接即可下载
161-
3. 如何将 **”CPK-RA6M4板级支持包“**添加到 FSP 中,请参考文档[如何导入板级支持包](https://www2.renesas.cn/document/ppt/1527171?language=zh&r=1527191)
162-
4. 请查看文档:[使用瑞萨 FSP 配置工具](./docs/使用瑞萨FSP配置工具.md)。在 MDK 中通过添加自定义命名来打开当前工程的 FSP 配置。
146+
**注意**
147+
RASC 生成的`bsp_linker_info.h`,要么直接删掉,要么根据使用的开发环境来选择覆盖到`$(BSP_ROOT)/script/bsp_link/gcc` 或 `$(BSP_ROOT)/script/bsp_link/keil`
163148
164149
**ENV 配置**
165150
166151
- 如何使用 ENV 工具:[RT-Thread env 工具用户手册](https://www.rt-thread.org/document/site/#/development-tools/env/env)
167152
168-
此 BSP 默认只开启了 UART7 的功能,如果需使用更多高级功能例如组件、软件包等,需要利用 ENV 工具进行配置。
153+
此 BSP 默认只开启了 UART9 的功能,如果需使用更多高级功能例如组件、软件包等,需要利用 ENV 工具进行配置。
169154
170155
步骤如下:
171156
1. 在 bsp 下打开 env 工具。
172157
2. 输入`menuconfig`命令配置工程,配置好之后保存退出。
173158
3. 输入`pkgs --update`命令更新软件包。
174159
4. 输入`scons --target=mdk5` 命令重新生成工程。
175160
176-
177161
## FAQ
178162
179-
### 使用 MDK 的 DEBUG 时如果遇到提示 “Error: Flash Download failed Cortex-M33” 怎么办?
163+
### 使用 MDK 的 DEBUG 时如果遇到提示 “Error: Flash Download failed Cortex-M23” 怎么办?
180164
181165
可按照下图操作,修改 Utilities 中的选项:
182166

bsp/renesas/ra2e2-ek/board/Kconfig

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
menu "Hardware Drivers Config"
22

3-
config SOC_R7FA2E2A7
4-
bool
5-
select SOC_SERIES_R7FA2E2
6-
select RT_USING_COMPONENTS_INIT
7-
select RT_USING_USER_MAIN
8-
default y
9-
103
menu "Onboard Peripheral Drivers"
114

125
endmenu
136

147
menu "On-chip Peripheral Drivers"
158

16-
rsource "../../libraries/HAL_Drivers/Kconfig"
9+
rsource "../../libraries/HAL_Drivers/drivers/Kconfig"
1710

1811
menuconfig BSP_USING_UART
1912
bool "Enable UART"

bsp/renesas/ra2e2-ek/board/ports/gpio_cfg.h

Lines changed: 10 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -9,73 +9,36 @@
99
*/
1010

1111
/* Number of IRQ channels on the device */
12-
#define RA_IRQ_MAX 16
12+
#define RA_IRQ_MAX 8
1313

1414
/* PIN to IRQx table */
1515
#define PIN2IRQX_TABLE \
1616
{ \
1717
switch (pin) \
1818
{ \
19+
case BSP_IO_PORT_03_PIN_00: \
1920
case BSP_IO_PORT_04_PIN_00: \
20-
case BSP_IO_PORT_02_PIN_06: \
21-
case BSP_IO_PORT_01_PIN_05: \
2221
return 0; \
23-
case BSP_IO_PORT_02_PIN_05: \
2422
case BSP_IO_PORT_01_PIN_01: \
25-
case BSP_IO_PORT_01_PIN_04: \
23+
case BSP_IO_PORT_01_PIN_12: \
24+
case BSP_IO_PORT_02_PIN_05: \
2625
return 1; \
27-
case BSP_IO_PORT_02_PIN_03: \
2826
case BSP_IO_PORT_01_PIN_00: \
29-
case BSP_IO_PORT_02_PIN_13: \
27+
case BSP_IO_PORT_09_PIN_14: \
3028
return 2; \
31-
case BSP_IO_PORT_02_PIN_02: \
3229
case BSP_IO_PORT_01_PIN_10: \
33-
case BSP_IO_PORT_02_PIN_12: \
3430
return 3; \
35-
case BSP_IO_PORT_04_PIN_02: \
31+
case BSP_IO_PORT_01_PIN_02: \
3632
case BSP_IO_PORT_01_PIN_11: \
37-
case BSP_IO_PORT_04_PIN_11: \
3833
return 4; \
34+
case BSP_IO_PORT_01_PIN_08: \
3935
case BSP_IO_PORT_04_PIN_01: \
40-
case BSP_IO_PORT_03_PIN_02: \
41-
case BSP_IO_PORT_04_PIN_10: \
4236
return 5; \
43-
case BSP_IO_PORT_03_PIN_01: \
44-
case BSP_IO_PORT_00_PIN_00: \
45-
case BSP_IO_PORT_04_PIN_09: \
37+
case BSP_IO_PORT_01_PIN_03: \
4638
return 6; \
47-
case BSP_IO_PORT_00_PIN_01: \
48-
case BSP_IO_PORT_04_PIN_08: \
49-
return 7; \
50-
case BSP_IO_PORT_00_PIN_02: \
51-
case BSP_IO_PORT_03_PIN_05: \
52-
case BSP_IO_PORT_04_PIN_15: \
53-
return 8; \
54-
case BSP_IO_PORT_00_PIN_04: \
55-
case BSP_IO_PORT_03_PIN_04: \
56-
case BSP_IO_PORT_04_PIN_14: \
57-
return 9; \
58-
case BSP_IO_PORT_00_PIN_05: \
59-
case BSP_IO_PORT_07_PIN_09: \
60-
return 10; \
61-
case BSP_IO_PORT_05_PIN_01: \
62-
case BSP_IO_PORT_00_PIN_06: \
63-
case BSP_IO_PORT_07_PIN_08: \
64-
return 11; \
65-
case BSP_IO_PORT_05_PIN_02: \
66-
case BSP_IO_PORT_00_PIN_08: \
67-
return 12; \
6839
case BSP_IO_PORT_00_PIN_15: \
69-
case BSP_IO_PORT_00_PIN_09: \
70-
return 13; \
71-
case BSP_IO_PORT_04_PIN_03: \
72-
case BSP_IO_PORT_05_PIN_12: \
73-
case BSP_IO_PORT_05_PIN_05: \
74-
return 14; \
75-
case BSP_IO_PORT_04_PIN_04: \
76-
case BSP_IO_PORT_05_PIN_11: \
77-
case BSP_IO_PORT_05_PIN_06: \
78-
return 15; \
40+
case BSP_IO_PORT_01_PIN_09: \
41+
return 7; \
7942
default : \
8043
return -1; \
8144
} \
58.5 KB
Loading
58.7 KB
Loading
132 KB
Loading
3.11 KB
Loading

0 commit comments

Comments
 (0)