From 2159c295e9318f888a0763dd6ad28562c2e0ca5a Mon Sep 17 00:00:00 2001 From: alt-0191 <2223147307@qq.com> Date: Mon, 2 Mar 2026 23:58:06 +0800 Subject: test: fix ch58x linker errors by adding libc/libgcc and libISP583 --- hw/bsp/ch58x/family.cmake | 7 +++++-- hw/bsp/ch58x/family.mk | 9 +++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/hw/bsp/ch58x/family.cmake b/hw/bsp/ch58x/family.cmake index 3e12efb7a..b4835cb41 100644 --- a/hw/bsp/ch58x/family.cmake +++ b/hw/bsp/ch58x/family.cmake @@ -42,6 +42,9 @@ function(family_add_board BOARD_TARGET) ${SDK_SRC_DIR}/StdPeriphDriver/inc ${CMAKE_CURRENT_FUNCTION_LIST_DIR} ) + target_link_libraries(${BOARD_TARGET} PUBLIC + ${SDK_SRC_DIR}/StdPeriphDriver/libISP583.a + ) target_compile_definitions(${BOARD_TARGET} PUBLIC CFG_TUD_WCH_USBIP_USBFS=1 FREQ_SYS=60000000 @@ -86,8 +89,8 @@ function(family_configure_example TARGET RTOS) if (CMAKE_C_COMPILER_ID STREQUAL "GNU") target_link_options(${TARGET} PUBLIC - -nostdlib -nostartfiles - --specs=nosys.specs + -nostartfiles + --specs=nosys.specs --specs=nano.specs -Wl,--defsym=__FLASH_SIZE=${LD_FLASH_SIZE} -Wl,--defsym=__RAM_SIZE=${LD_RAM_SIZE} "LINKER:--script=${LD_FILE_GNU}" diff --git a/hw/bsp/ch58x/family.mk b/hw/bsp/ch58x/family.mk index 7b62af646..71c2cada6 100644 --- a/hw/bsp/ch58x/family.mk +++ b/hw/bsp/ch58x/family.mk @@ -24,12 +24,13 @@ CFLAGS += \ -DFREQ_SYS=60000000 \ -DDISK_LIB_ENABLE=0 \ -DINT_SOFT \ - -CFLAGS += -Wno-error=strict-prototypes + -Wno-error=strict-prototypes LDFLAGS_GCC += \ - -nostdlib -nostartfiles \ - --specs=nosys.specs \ + -nostartfiles \ + --specs=nosys.specs --specs=nano.specs \ + +LIBS += $(TOP)/$(SDK_SRC_DIR)/StdPeriphDriver/libISP583.a SRC_C += \ src/portable/wch/dcd_ch58x_usbfs.c \ -- cgit v1.3.1