diff --git a/bsp/renesas/ebf_qi_min_6m5/.config b/bsp/renesas/ebf_qi_min_6m5/.config index f9857851c2..7a847706e7 100644 --- a/bsp/renesas/ebf_qi_min_6m5/.config +++ b/bsp/renesas/ebf_qi_min_6m5/.config @@ -1019,7 +1019,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y # CONFIG_SOC_SERIES_R7FA6M3 is not set # CONFIG_SOC_SERIES_R7FA6M4 is not set # CONFIG_SOC_SERIES_R7FA2L1 is not set diff --git a/bsp/renesas/libraries/HAL_Drivers/drv_gpio.c b/bsp/renesas/libraries/HAL_Drivers/drv_gpio.c index 13dc033a4e..374a0a6d4d 100644 --- a/bsp/renesas/libraries/HAL_Drivers/drv_gpio.c +++ b/bsp/renesas/libraries/HAL_Drivers/drv_gpio.c @@ -7,6 +7,7 @@ * Date Author Notes * 2021-07-29 KyleChan first version * 2022-01-19 Sherman add PIN2IRQX_TABLE + * 2025-01-13 newflydd pin_get for RZ */ #include @@ -304,37 +305,31 @@ static rt_err_t ra_pin_dettach_irq(struct rt_device *device, rt_base_t pin) static rt_base_t ra_pin_get(const char *name) { - int pin_number = -1, port = -1, pin = -1; - - if (rt_strlen(name) != 4) - return -1; - - if ((name[0] == 'P' || name[0] == 'p')) +#ifdef SOC_FAMILY_RENESAS_RZ + /* RZ series: use "PXX_X" format, like "P01_1" */ + if ((rt_strlen(name) == 5) && + ((name[0] == 'P') || (name[0] == 'p')) && + (name[3] == '_') && + ('0' <= (int) name[1] && (int) name[1] <= '1') && + ('0' <= (int) name[2] && (int) name[2] <= '9') && + ('0' <= (int) name[4] && (int) name[4] <= '7')) { - if ('0' <= name[1] && name[1] <= '9') - { - port = (name[1] - '0') * 16 * 16; - if ('0' <= name[2] && name[2] <= '9' && '0' <= name[3] && name[3] <= '9') - { - pin = (name[2] - '0') * 10 + (name[3] - '0'); - pin_number = port + pin; - - return pin_number; - } - } - else if ('A' <= name[1] && name[1] <= 'Z') - { - port = (name[1] - '0' - 7) * 16 * 16; - if ('0' <= name[2] && name[2] <= '9' && '0' <= name[3] && name[3] <= '9') - { - pin = (name[2] - '0') * 10 + (name[3] - '0'); - pin_number = port + pin; - - return pin_number; - } - } + return (((int) name[1] - '0') * 10 + ((int) name[2] - '0')) * 0x100 + ((int) name[4] - '0'); } - return -1; + LOG_W("Invalid pin expression, use `PXX_X` format like `P01_1`"); +#else + /* RA series: use "PXXX" format, like "P101"*/ + if ((rt_strlen(name) == 4) && + (name[0] == 'P' || name[0] == 'p') && + (name[1] >= '0' && name[1] <= '9') && + (name[2] >= '0' && name[1] <= '9') && + (name[3] >= '0' && name[1] <= '9')) + { + return (name[1] - '0') * 0x100 + (name[2] - '0') * 10 + (name[3] - '0'); + } + LOG_W("Invalid pin expression, use `PXXX` format like `P101`"); +#endif + return -RT_ERROR; } const static struct rt_pin_ops _ra_pin_ops = diff --git a/bsp/renesas/libraries/HAL_Drivers/drv_sci.c b/bsp/renesas/libraries/HAL_Drivers/drv_sci.c index 93d31dd2e3..1fec7550d4 100644 --- a/bsp/renesas/libraries/HAL_Drivers/drv_sci.c +++ b/bsp/renesas/libraries/HAL_Drivers/drv_sci.c @@ -358,7 +358,11 @@ static int ra_uart_putc(struct rt_serial_device *serial, char c) sci_uart_instance_ctrl_t *p_ctrl = (sci_uart_instance_ctrl_t *)param->sci_ctrl; p_ctrl->p_reg->TDR = c; +#ifdef SOC_SERIES_R9A07G0 + while ((p_ctrl->p_reg->CSR_b.TEND) == 0); +#else while ((p_ctrl->p_reg->SSR_b.TEND) == 0); +#endif return RT_EOK; } diff --git a/bsp/renesas/libraries/Kconfig b/bsp/renesas/libraries/Kconfig index 8aad8b4fc5..3fc28972aa 100644 --- a/bsp/renesas/libraries/Kconfig +++ b/bsp/renesas/libraries/Kconfig @@ -1,52 +1,56 @@ -config SOC_FAMILY_RENESAS +config SOC_FAMILY_RENESAS_RA + bool + default n + +config SOC_FAMILY_RENESAS_RZ bool default n config SOC_SERIES_R7FA6M3 bool select ARCH_ARM_CORTEX_M4 - select SOC_FAMILY_RENESAS + select SOC_FAMILY_RENESAS_RA default n config SOC_SERIES_R7FA6M4 bool select ARCH_ARM_CORTEX_M4 - select SOC_FAMILY_RENESAS + select SOC_FAMILY_RENESAS_RA default n config SOC_SERIES_R7FA2L1 bool select ARCH_ARM_CORTEX_M23 - select SOC_FAMILY_RENESAS + select SOC_FAMILY_RENESAS_RA default n config SOC_SERIES_R7FA6M5 bool select ARCH_ARM_CORTEX_M33 - select SOC_FAMILY_RENESAS + select SOC_FAMILY_RENESAS_RA default n config SOC_SERIES_R7FA4M2 bool select ARCH_ARM_CORTEX_M4 - select SOC_FAMILY_RENESAS + select SOC_FAMILY_RENESAS_RA default n config SOC_SERIES_R7FA8M85 bool select ARCH_ARM_CORTEX_M85 - select SOC_FAMILY_RENESAS + select SOC_FAMILY_RENESAS_RA default n config SOC_SERIES_R9A07G0 bool select ARCH_ARM_CORTEX_R52 - select SOC_FAMILY_RENESAS + select SOC_FAMILY_RENESAS_RZ default n config SOC_SERIES_R7FA6E2 bool select ARCH_ARM_CORTEX_M33 - select SOC_FAMILY_RENESAS + select SOC_FAMILY_RENESAS_RA default n \ No newline at end of file diff --git a/bsp/renesas/libraries/bsp-template/.config b/bsp/renesas/libraries/bsp-template/.config index 5907b30992..cbf525b8b7 100644 --- a/bsp/renesas/libraries/bsp-template/.config +++ b/bsp/renesas/libraries/bsp-template/.config @@ -657,7 +657,7 @@ CONFIG_SOC_R7FA6M4AF=y # # On-chip Peripheral Drivers # -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y CONFIG_SOC_SERIES_R7FA6M4=y CONFIG_BSP_USING_GPIO=y # CONFIG_BSP_USING_ONCHIP_FLASH is not set diff --git a/bsp/renesas/ra2l1-cpk/.config b/bsp/renesas/ra2l1-cpk/.config index 980c8b2982..ebe2524e3b 100644 --- a/bsp/renesas/ra2l1-cpk/.config +++ b/bsp/renesas/ra2l1-cpk/.config @@ -1035,7 +1035,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y # CONFIG_SOC_SERIES_R7FA6M3 is not set # CONFIG_SOC_SERIES_R7FA6M4 is not set CONFIG_SOC_SERIES_R7FA2L1=y diff --git a/bsp/renesas/ra4m2-eco/.config b/bsp/renesas/ra4m2-eco/.config index f14dd22fde..5daf1c7f7a 100644 --- a/bsp/renesas/ra4m2-eco/.config +++ b/bsp/renesas/ra4m2-eco/.config @@ -1036,7 +1036,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y # CONFIG_SOC_SERIES_R7FA6M3 is not set # CONFIG_SOC_SERIES_R7FA6M4 is not set # CONFIG_SOC_SERIES_R7FA2L1 is not set diff --git a/bsp/renesas/ra6e2-fpb/.config b/bsp/renesas/ra6e2-fpb/.config index 4c0b5775ba..fe980b065c 100644 --- a/bsp/renesas/ra6e2-fpb/.config +++ b/bsp/renesas/ra6e2-fpb/.config @@ -1153,7 +1153,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # end of Arduino libraries # end of RT-Thread online packages -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y CONFIG_SOC_SERIES_R7FA6E2=y # diff --git a/bsp/renesas/ra6m3-ek/.config b/bsp/renesas/ra6m3-ek/.config index f229aa8fc5..2f7745c475 100644 --- a/bsp/renesas/ra6m3-ek/.config +++ b/bsp/renesas/ra6m3-ek/.config @@ -1021,7 +1021,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y CONFIG_SOC_SERIES_R7FA6M3=y # CONFIG_SOC_SERIES_R7FA6M4 is not set # CONFIG_SOC_SERIES_R7FA2L1 is not set diff --git a/bsp/renesas/ra6m3-hmi-board/.config b/bsp/renesas/ra6m3-hmi-board/.config index 8e4fd18258..99f4374331 100644 --- a/bsp/renesas/ra6m3-hmi-board/.config +++ b/bsp/renesas/ra6m3-hmi-board/.config @@ -1271,7 +1271,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # end of Arduino libraries # end of RT-Thread online packages -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y CONFIG_SOC_SERIES_R7FA6M3=y # diff --git a/bsp/renesas/ra6m4-cpk/.config b/bsp/renesas/ra6m4-cpk/.config index a0348aae9b..e7ec3caa4b 100644 --- a/bsp/renesas/ra6m4-cpk/.config +++ b/bsp/renesas/ra6m4-cpk/.config @@ -1027,7 +1027,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y # CONFIG_SOC_SERIES_R7FA6M3 is not set CONFIG_SOC_SERIES_R7FA6M4=y # CONFIG_SOC_SERIES_R7FA2L1 is not set diff --git a/bsp/renesas/ra6m4-iot/.config b/bsp/renesas/ra6m4-iot/.config index 5b5b9006da..8ffe139504 100644 --- a/bsp/renesas/ra6m4-iot/.config +++ b/bsp/renesas/ra6m4-iot/.config @@ -1021,7 +1021,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y # CONFIG_SOC_SERIES_R7FA6M3 is not set CONFIG_SOC_SERIES_R7FA6M4=y # CONFIG_SOC_SERIES_R7FA2L1 is not set diff --git a/bsp/renesas/ra8d1-ek/.config b/bsp/renesas/ra8d1-ek/.config index 260dee73f5..9f7c773608 100644 --- a/bsp/renesas/ra8d1-ek/.config +++ b/bsp/renesas/ra8d1-ek/.config @@ -1022,7 +1022,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y # CONFIG_SOC_SERIES_R7FA6M3 is not set # CONFIG_SOC_SERIES_R7FA6M4 is not set # CONFIG_SOC_SERIES_R7FA2L1 is not set diff --git a/bsp/renesas/ra8d1-vision-board/.config b/bsp/renesas/ra8d1-vision-board/.config index 6be24dfabc..7407aa269c 100644 --- a/bsp/renesas/ra8d1-vision-board/.config +++ b/bsp/renesas/ra8d1-vision-board/.config @@ -1057,7 +1057,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y # CONFIG_SOC_SERIES_R7FA6M3 is not set # CONFIG_SOC_SERIES_R7FA6M4 is not set # CONFIG_SOC_SERIES_R7FA2L1 is not set diff --git a/bsp/renesas/ra8m1-ek/.config b/bsp/renesas/ra8m1-ek/.config index 5937a4dbb9..3d19aca83f 100644 --- a/bsp/renesas/ra8m1-ek/.config +++ b/bsp/renesas/ra8m1-ek/.config @@ -1054,7 +1054,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RA=y # CONFIG_SOC_SERIES_R7FA6M3 is not set # CONFIG_SOC_SERIES_R7FA6M4 is not set # CONFIG_SOC_SERIES_R7FA2L1 is not set diff --git a/bsp/renesas/rzn2l_rsk/.config b/bsp/renesas/rzn2l_rsk/.config index 6f402d9bc8..fe7576d35f 100644 --- a/bsp/renesas/rzn2l_rsk/.config +++ b/bsp/renesas/rzn2l_rsk/.config @@ -1151,7 +1151,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # end of Arduino libraries # end of RT-Thread online packages -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RZ=y CONFIG_SOC_SERIES_R9A07G0=y # diff --git a/bsp/renesas/rzt2m_rsk/.config b/bsp/renesas/rzt2m_rsk/.config index fed1a4dea6..7beaa50421 100644 --- a/bsp/renesas/rzt2m_rsk/.config +++ b/bsp/renesas/rzt2m_rsk/.config @@ -1054,7 +1054,7 @@ CONFIG_RT_LIBC_TZ_DEFAULT_SEC=0 # Uncategorized # # CONFIG_PKG_USING_MICRO_ROS_RTTHREAD_PACKAGE is not set -CONFIG_SOC_FAMILY_RENESAS=y +CONFIG_SOC_FAMILY_RENESAS_RZ=y # CONFIG_SOC_SERIES_R7FA6M3 is not set # CONFIG_SOC_SERIES_R7FA6M4 is not set # CONFIG_SOC_SERIES_R7FA2L1 is not set