From bbc45da16c41b746483f592b913bb470cba34875 Mon Sep 17 00:00:00 2001
From: Leeto <821522988@qq.com>
Date: Wed, 16 Sep 2026 17:54:41 +0800
Subject: [HC32][BSP] Delete PM_TICKLESS_TIMER_ENABLE_MASK in pm_config.h,
modify 'NAME_MAX' to 24 #11798
---
bsp/hc32/.clang-format-ignore | 3 +-
bsp/hc32/README.md | 2 +
bsp/hc32/ev_hc32f334_lqfp64/.config | 2 +-
.../ev_hc32f334_lqfp64/board/config/mcan_config.h | 4 +-
.../ev_hc32f334_lqfp64/board/config/pm_config.h | 7 +-
bsp/hc32/ev_hc32f334_lqfp64/rtconfig.h | 2 +-
bsp/hc32/ev_hc32f448_lqfp80/.config | 2 +-
.../ev_hc32f448_lqfp80/board/config/mcan_config.h | 4 +-
.../ev_hc32f448_lqfp80/board/config/pm_config.h | 7 +-
bsp/hc32/ev_hc32f460_lqfp100_v2/.config | 2 +-
bsp/hc32/ev_hc32f460_lqfp100_v2/board/Kconfig | 1 +
.../board/config/pm_config.h | 5 +-
.../board/ports/usb_config.h | 9 -
bsp/hc32/ev_hc32f460_lqfp100_v2/rtconfig.h | 2 +-
bsp/hc32/ev_hc32f467_lqfp144/project.ewp | 19 +-
bsp/hc32/ev_hc32f467_lqfp144/project.uvoptx | 1141 ++++++++++++++-
bsp/hc32/ev_hc32f467_lqfp144/project.uvprojx | 1502 +++++++++++++++++---
bsp/hc32/ev_hc32f472_lqfp100/.config | 2 +-
.../ev_hc32f472_lqfp100/board/config/pm_config.h | 7 +-
.../ev_hc32f472_lqfp100/board/ports/usb_config.h | 9 -
bsp/hc32/ev_hc32f472_lqfp100/project.ewp | 169 ++-
bsp/hc32/ev_hc32f472_lqfp100/project.uvprojx | 174 ++-
bsp/hc32/ev_hc32f472_lqfp100/rtconfig.h | 2 +-
bsp/hc32/ev_hc32f4a0_lqfp176/.config | 2 +-
bsp/hc32/ev_hc32f4a0_lqfp176/board/Kconfig | 1 +
.../ev_hc32f4a0_lqfp176/board/config/pm_config.h | 5 +-
bsp/hc32/ev_hc32f4a0_lqfp176/board/hc32f4xx_conf.h | 2 +-
.../ev_hc32f4a0_lqfp176/board/ports/usb_config.h | 9 -
bsp/hc32/ev_hc32f4a0_lqfp176/rtconfig.h | 2 +-
bsp/hc32/ev_hc32f4a2_lqfp176/.config | 23 +-
bsp/hc32/ev_hc32f4a2_lqfp176/project.ewp | 19 +-
bsp/hc32/ev_hc32f4a2_lqfp176/project.uvprojx | 35 +-
bsp/hc32/ev_hc32f4a8_lqfp176/.config | 2 +-
bsp/hc32/ev_hc32f4a8_lqfp176/board/Kconfig | 5 +-
.../ev_hc32f4a8_lqfp176/board/config/mcan_config.h | 4 +-
.../ev_hc32f4a8_lqfp176/board/config/pm_config.h | 5 +-
.../ev_hc32f4a8_lqfp176/board/ports/usb_config.h | 9 -
bsp/hc32/ev_hc32f4a8_lqfp176/rtconfig.h | 2 +-
bsp/hc32/lckfb-hc32f4a0-lqfp100/.config | 2 +-
bsp/hc32/lckfb-hc32f4a0-lqfp100/board/Kconfig | 9 +-
.../board/config/pm_config.h | 7 +-
bsp/hc32/libraries/hc32_drivers/drv_can.c | 4 +
bsp/hc32/libraries/hc32_drivers/drv_irq.c | 5 +-
bsp/hc32/libraries/hc32_drivers/drv_pm.c | 2 +
bsp/hc32/libraries/hc32_drivers/drv_pwm.c | 6 +
bsp/hc32/libraries/hc32_drivers/drv_spi.c | 8 +
bsp/hc32/libraries/hc32_drivers/drv_usart.c | 3 +-
bsp/hc32/libraries/hc32_drivers/drv_usart_v2.c | 3 +-
bsp/hc32/platform/cherryusb/SConscript | 18 -
bsp/hc32/platform/cherryusb/cherryusb_port.c | 290 ----
bsp/hc32/tests/test_clock_timer.c | 3 +-
bsp/hc32/tests/test_soft_i2c.c | 2 +
52 files changed, 2844 insertions(+), 720 deletions(-)
delete mode 100644 bsp/hc32/platform/cherryusb/SConscript
delete mode 100644 bsp/hc32/platform/cherryusb/cherryusb_port.c
diff --git a/bsp/hc32/.clang-format-ignore b/bsp/hc32/.clang-format-ignore
index d3ecbb8d5b..1d3f75eda2 100644
--- a/bsp/hc32/.clang-format-ignore
+++ b/bsp/hc32/.clang-format-ignore
@@ -1,2 +1,3 @@
-# clang-format ignore file
+# clang-format ignore file
/libraries/hc32_drivers/
+*/rtconfig.h
diff --git a/bsp/hc32/README.md b/bsp/hc32/README.md
index 523387d7e1..afc6c509cd 100644
--- a/bsp/hc32/README.md
+++ b/bsp/hc32/README.md
@@ -11,8 +11,10 @@ HC32 系列 BSP 目前支持情况如下表所示:
| **F4 系列** | |
| [ev_hc32f448_lqfp80](ev_hc32f448_lqfp80) | 小华 官方 EV_F448_LQ80 开发板 |
| [ev_hc32f460_lqfp100_v2](ev_hc32f460_lqfp100_v2) | 小华 官方 EV_F460_LQ100_V2 开发板 |
+| [ev_hc32f467_lqfp144](ev_hc32f467_lqfp176) | 小华 官方 EV_F467_LQ144 开发板 |
| [ev_hc32f472_lqfp100](ev_hc32f472_lqfp100) | 小华 官方 EV_F472_LQ100 开发板 |
| [ev_hc32f4a0_lqfp176](ev_hc32f4a0_lqfp176) | 小华 官方 EV_F4A0_LQ176 开发板 |
+| [ev_hc32f4a2_lqfp176](ev_hc32f4a2_lqfp176) | 小华 官方 EV_F4A0_LQ176 开发板 |
| [lckfb-hc32f4a0-lqfp100](lckfb-hc32f4a0-lqfp100) | 立创开发板 天空星-HC32F4A0PITB |
| [ev_hc32f4a8_lqfp176](ev_hc32f4a8_lqfp176) | 小华 官方 EV_F4A8_LQ176 开发板 |
| **M1 系列** | |
diff --git a/bsp/hc32/ev_hc32f334_lqfp64/.config b/bsp/hc32/ev_hc32f334_lqfp64/.config
index 8c1d2ea196..62b9171d84 100644
--- a/bsp/hc32/ev_hc32f334_lqfp64/.config
+++ b/bsp/hc32/ev_hc32f334_lqfp64/.config
@@ -106,7 +106,7 @@
# end of rt_strnlen options
# end of klibc options
-CONFIG_RT_NAME_MAX=12
+CONFIG_RT_NAME_MAX=24
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
# CONFIG_RT_USING_NANO is not set
# CONFIG_RT_USING_SMART is not set
diff --git a/bsp/hc32/ev_hc32f334_lqfp64/board/config/mcan_config.h b/bsp/hc32/ev_hc32f334_lqfp64/board/config/mcan_config.h
index c3e8d7f52a..756535af91 100644
--- a/bsp/hc32/ev_hc32f334_lqfp64/board/config/mcan_config.h
+++ b/bsp/hc32/ev_hc32f334_lqfp64/board/config/mcan_config.h
@@ -24,9 +24,9 @@ extern "C" {
For the message RAM:
1. MCAN1 and MCAN2 share 2048 bytes message RAM
2. User can modify the definitions of filter number, Rx FIFO number, Tx FIFO number.
- 3. MCAN has two configurable Receive FIFOs, Rx FIFO0 and Rx FIFO1. There use Rx FIFO0 only by default.
+ 3. MCAN has two configurable Receive FIFOs, Rx FIFO0 and Rx FIFO1. There use Rx FIFO0 only by default.
If only one FIFO is needed, use Rx FIFO0. If Rx FIFO1 is needed, define it's macro between 1 and 64,
- and pay attention the total size of meesage RAM that to be allocated.
+ and pay attention the total size of message RAM that to be allocated.
*/
#ifdef RT_CAN_USING_CANFD
diff --git a/bsp/hc32/ev_hc32f334_lqfp64/board/config/pm_config.h b/bsp/hc32/ev_hc32f334_lqfp64/board/config/pm_config.h
index 4357f8e113..0fe614827b 100644
--- a/bsp/hc32/ev_hc32f334_lqfp64/board/config/pm_config.h
+++ b/bsp/hc32/ev_hc32f334_lqfp64/board/config/pm_config.h
@@ -6,6 +6,7 @@
* Change Logs:
* Date Author Notes
* 2024-02-20 CDT first version
+ * 2026-06-24 CDT delete PM_TICKLESS_TIMER_ENABLE_MASK for unsupport pm tickless timer
*/
#ifndef __PM_CONFIG_H__
@@ -20,12 +21,6 @@ extern "C" {
#ifdef BSP_USING_PM
extern void rt_hw_board_pm_sysclk_cfg(uint8_t run_mode);
-#ifndef PM_TICKLESS_TIMER_ENABLE_MASK
-#define PM_TICKLESS_TIMER_ENABLE_MASK \
- ((1UL << PM_SLEEP_MODE_IDLE) | \
- (1UL << PM_SLEEP_MODE_DEEP))
-#endif
-
/**
* @brief run mode config @ref pm_run_mode_config structure
*/
diff --git a/bsp/hc32/ev_hc32f334_lqfp64/rtconfig.h b/bsp/hc32/ev_hc32f334_lqfp64/rtconfig.h
index 7935d7a9bd..663562a2d2 100644
--- a/bsp/hc32/ev_hc32f334_lqfp64/rtconfig.h
+++ b/bsp/hc32/ev_hc32f334_lqfp64/rtconfig.h
@@ -61,7 +61,7 @@
/* end of rt_strnlen options */
/* end of klibc options */
-#define RT_NAME_MAX 12
+#define RT_NAME_MAX 24
#define RT_CPUS_NR 1
#define RT_ALIGN_SIZE 8
#define RT_THREAD_PRIORITY_32
diff --git a/bsp/hc32/ev_hc32f448_lqfp80/.config b/bsp/hc32/ev_hc32f448_lqfp80/.config
index 562533d9e4..c2e2bc987d 100644
--- a/bsp/hc32/ev_hc32f448_lqfp80/.config
+++ b/bsp/hc32/ev_hc32f448_lqfp80/.config
@@ -106,7 +106,7 @@
# end of rt_strnlen options
# end of klibc options
-CONFIG_RT_NAME_MAX=12
+CONFIG_RT_NAME_MAX=24
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
# CONFIG_RT_USING_NANO is not set
# CONFIG_RT_USING_SMART is not set
diff --git a/bsp/hc32/ev_hc32f448_lqfp80/board/config/mcan_config.h b/bsp/hc32/ev_hc32f448_lqfp80/board/config/mcan_config.h
index 0c9bb9263a..b79ab4773d 100644
--- a/bsp/hc32/ev_hc32f448_lqfp80/board/config/mcan_config.h
+++ b/bsp/hc32/ev_hc32f448_lqfp80/board/config/mcan_config.h
@@ -25,9 +25,9 @@ extern "C" {
For the message RAM:
1. MCAN1 and MCAN2 share 2048 bytes message RAM
2. User can modify the definitions of filter number, Rx FIFO number, Tx FIFO number.
- 3. MCAN has two configurable Receive FIFOs, Rx FIFO0 and Rx FIFO1. There use Rx FIFO0 only by default.
+ 3. MCAN has two configurable Receive FIFOs, Rx FIFO0 and Rx FIFO1. There use Rx FIFO0 only by default.
If only one FIFO is needed, use Rx FIFO0. If Rx FIFO1 is needed, define it's macro between 1 and 64,
- and pay attention the total size of meesage RAM that to be allocated.
+ and pay attention the total size of message RAM that to be allocated.
*/
#ifdef RT_CAN_USING_CANFD
diff --git a/bsp/hc32/ev_hc32f448_lqfp80/board/config/pm_config.h b/bsp/hc32/ev_hc32f448_lqfp80/board/config/pm_config.h
index 8dc37b7f23..1e5b5c9a8e 100644
--- a/bsp/hc32/ev_hc32f448_lqfp80/board/config/pm_config.h
+++ b/bsp/hc32/ev_hc32f448_lqfp80/board/config/pm_config.h
@@ -7,6 +7,7 @@
* Change Logs:
* Date Author Notes
* 2024-02-20 CDT first version
+ * 2026-06-24 CDT delete PM_TICKLESS_TIMER_ENABLE_MASK for unsupport pm tickless timer
*/
#ifndef __PM_CONFIG_H__
@@ -21,12 +22,6 @@ extern "C" {
#ifdef BSP_USING_PM
extern void rt_hw_board_pm_sysclk_cfg(uint8_t run_mode);
-#ifndef PM_TICKLESS_TIMER_ENABLE_MASK
-#define PM_TICKLESS_TIMER_ENABLE_MASK \
- ((1UL << PM_SLEEP_MODE_IDLE) | \
- (1UL << PM_SLEEP_MODE_DEEP))
-#endif
-
/**
* @brief run mode config @ref pm_run_mode_config structure
*/
diff --git a/bsp/hc32/ev_hc32f460_lqfp100_v2/.config b/bsp/hc32/ev_hc32f460_lqfp100_v2/.config
index 2791e070dc..c0e748d851 100644
--- a/bsp/hc32/ev_hc32f460_lqfp100_v2/.config
+++ b/bsp/hc32/ev_hc32f460_lqfp100_v2/.config
@@ -106,7 +106,7 @@
# end of rt_strnlen options
# end of klibc options
-CONFIG_RT_NAME_MAX=12
+CONFIG_RT_NAME_MAX=24
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
# CONFIG_RT_USING_NANO is not set
# CONFIG_RT_USING_SMART is not set
diff --git a/bsp/hc32/ev_hc32f460_lqfp100_v2/board/Kconfig b/bsp/hc32/ev_hc32f460_lqfp100_v2/board/Kconfig
index 08a05019a7..257c596051 100644
--- a/bsp/hc32/ev_hc32f460_lqfp100_v2/board/Kconfig
+++ b/bsp/hc32/ev_hc32f460_lqfp100_v2/board/Kconfig
@@ -407,6 +407,7 @@ menu "On-chip Peripheral Drivers"
bool "Enable SDIO"
default n
select RT_USING_SDIO
+ select RT_USING_DFS
if BSP_USING_SDIO
config BSP_USING_SDIO1
bool "Enable SDIO1"
diff --git a/bsp/hc32/ev_hc32f460_lqfp100_v2/board/config/pm_config.h b/bsp/hc32/ev_hc32f460_lqfp100_v2/board/config/pm_config.h
index 4ce382797e..3b81defb71 100644
--- a/bsp/hc32/ev_hc32f460_lqfp100_v2/board/config/pm_config.h
+++ b/bsp/hc32/ev_hc32f460_lqfp100_v2/board/config/pm_config.h
@@ -8,6 +8,7 @@
* 2023-05-12 CDT first version
* 2024-06-13 CDT disable pm tickless timer
* delete member u16ExBusHold of PM_SLEEP_DEEP_CFG
+ * 2026-06-24 CDT delete PM_TICKLESS_TIMER_ENABLE_MASK for unsupport pm tickless timer
*/
#ifndef __PM_CONFIG_H__
@@ -22,10 +23,6 @@ extern "C" {
#ifdef BSP_USING_PM
extern void rt_hw_board_pm_sysclk_cfg(uint8_t run_mode);
-#ifndef PM_TICKLESS_TIMER_ENABLE_MASK
-#define PM_TICKLESS_TIMER_ENABLE_MASK (0UL)
-#endif
-
/**
* @brief run mode config @ref pm_run_mode_config structure
*/
diff --git a/bsp/hc32/ev_hc32f460_lqfp100_v2/board/ports/usb_config.h b/bsp/hc32/ev_hc32f460_lqfp100_v2/board/ports/usb_config.h
index 91c6a46fb4..d6d89441ad 100644
--- a/bsp/hc32/ev_hc32f460_lqfp100_v2/board/ports/usb_config.h
+++ b/bsp/hc32/ev_hc32f460_lqfp100_v2/board/ports/usb_config.h
@@ -295,13 +295,4 @@
#define CONFIG_USBHOST_PIPE_NUM 10
#endif
-
-#ifndef usb_phyaddr2ramaddr
-#define usb_phyaddr2ramaddr(addr) (addr)
-#endif
-
-#ifndef usb_ramaddr2phyaddr
-#define usb_ramaddr2phyaddr(addr) (addr)
-#endif
-
#endif
diff --git a/bsp/hc32/ev_hc32f460_lqfp100_v2/rtconfig.h b/bsp/hc32/ev_hc32f460_lqfp100_v2/rtconfig.h
index cffd14a036..c72cedfb2c 100644
--- a/bsp/hc32/ev_hc32f460_lqfp100_v2/rtconfig.h
+++ b/bsp/hc32/ev_hc32f460_lqfp100_v2/rtconfig.h
@@ -61,7 +61,7 @@
/* end of rt_strnlen options */
/* end of klibc options */
-#define RT_NAME_MAX 12
+#define RT_NAME_MAX 24
#define RT_CPUS_NR 1
#define RT_ALIGN_SIZE 8
#define RT_THREAD_PRIORITY_32
diff --git a/bsp/hc32/ev_hc32f467_lqfp144/project.ewp b/bsp/hc32/ev_hc32f467_lqfp144/project.ewp
index bf00eabf99..5470d6ac01 100644
--- a/bsp/hc32/ev_hc32f467_lqfp144/project.ewp
+++ b/bsp/hc32/ev_hc32f467_lqfp144/project.ewp
@@ -323,7 +323,6 @@
$PROJ_DIR$\..\..\..\libcpu\arm\common
$PROJ_DIR$\..\..\..\libcpu\arm\cortex-m4
$PROJ_DIR$\..\..\..\components\drivers\include
- $PROJ_DIR$\..\..\..\components\drivers\phy
$PROJ_DIR$\..\..\..\components\drivers\smp_call
$PROJ_DIR$\board
$PROJ_DIR$\board\ports
@@ -344,6 +343,7 @@
$PROJ_DIR$\packages\hc32-f4-cmsis-latest\Include
$PROJ_DIR$\packages\hc32-f4-cmsis-latest\Device\HDSC\hc32f467\Include
$PROJ_DIR$\..\platform\tca9539
+ $PROJ_DIR$\..\tests
$PROJ_DIR$\..\..\..\components\net\utest
@@ -318,29 +319,32 @@
@@ -1310,29 +1315,32 @@