Skip to content

Commit f2913b4

Browse files
committed
[bsp][renesas] Porting Renesas BSP nano with one-click switching
1 parent 06cffb4 commit f2913b4

File tree

6 files changed

+62
-21
lines changed

6 files changed

+62
-21
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright (c) 2006-2025, RT-Thread Development Team
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*
6+
* Change Logs:
7+
* Date Author Notes
8+
* 2021-07-29 KyleChan first version
9+
*/
10+
11+
#ifndef __UART_CONFIG_H__
12+
#define __UART_CONFIG_H__
13+
14+
#include <rtthread.h>
15+
#include "hal_data.h"
16+
17+
#ifdef __cplusplus
18+
extern "C" {
19+
#endif
20+
21+
#if defined(BSP_USING_UART9)
22+
#ifndef UART9_CONFIG
23+
#define UART9_CONFIG \
24+
{ \
25+
.name = "uart9", \
26+
.p_api_ctrl = &g_uart9_ctrl, \
27+
.p_cfg = &g_uart9_cfg, \
28+
}
29+
#endif /* UART9_CONFIG */
30+
#endif /* BSP_USING_UART9 */
31+
32+
#ifdef __cplusplus
33+
}
34+
#endif
35+
36+
#endif

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/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/rtconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#ifndef RT_CONFIG_H__
22
#define RT_CONFIG_H__
33

4+
#define SOC_R7FA2E2A7
5+
46
/* RT-Thread Kernel */
57

68
/* klibc options */
@@ -365,8 +367,6 @@
365367

366368
/* Hardware Drivers Config */
367369

368-
#define SOC_R7FA2E2A7
369-
370370
/* Onboard Peripheral Drivers */
371371

372372
/* On-chip Peripheral Drivers */

bsp/renesas/ra2e2-ek/src/hal_entry.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,27 @@
55
*
66
* Change Logs:
77
* Date Author Notes
8-
* 2021-10-10 Sherman first version
8+
* 2025-08-17 tomjieli first version
99
*/
1010
#include <rtthread.h>
1111
#include "hal_data.h"
12+
#ifdef RT_USING_NANO
13+
#include <drv_gpio.h>
14+
#else
1215
#include <rtdevice.h>
16+
#endif /* RT_USING_NANO */
1317

14-
#define LED3_PIN "P015" /* Onboard LED pins */
18+
#define LED3_PIN BSP_IO_PORT_00_PIN_15 /* Onboard LED pins */
1519

1620
void hal_entry(void)
1721
{
18-
rt_uint32_t led3_pin = rt_pin_get(LED3_PIN);
22+
rt_kprintf("\nHello RT-Thread!\n");
1923

2024
while (1)
2125
{
22-
rt_pin_write(led3_pin, PIN_HIGH);
23-
rt_thread_mdelay(500);
24-
rt_pin_write(led3_pin, PIN_LOW);
25-
rt_thread_mdelay(500);
26+
rt_pin_write(LED3_PIN, PIN_HIGH);
27+
rt_thread_mdelay(1000);
28+
rt_pin_write(LED3_PIN, PIN_LOW);
29+
rt_thread_mdelay(1000);
2630
}
2731
}

0 commit comments

Comments
 (0)