Skip to content

Commit bcb4795

Browse files
committed
test: fix ch58x linker errors by adding libc/libgcc and libISP583
1 parent f0ca228 commit bcb4795

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

hw/bsp/ch58x/family.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ function(family_add_board BOARD_TARGET)
4242
${SDK_SRC_DIR}/StdPeriphDriver/inc
4343
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
4444
)
45+
target_link_libraries(${BOARD_TARGET} PUBLIC
46+
${SDK_SRC_DIR}/StdPeriphDriver/libISP583.a
47+
)
4548
target_compile_definitions(${BOARD_TARGET} PUBLIC
4649
CFG_TUD_WCH_USBIP_USBFS=1
4750
FREQ_SYS=60000000
@@ -86,8 +89,8 @@ function(family_configure_example TARGET RTOS)
8689

8790
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
8891
target_link_options(${TARGET} PUBLIC
89-
-nostdlib -nostartfiles
90-
--specs=nosys.specs
92+
-nostartfiles
93+
--specs=nosys.specs --specs=nano.specs
9194
-Wl,--defsym=__FLASH_SIZE=${LD_FLASH_SIZE}
9295
-Wl,--defsym=__RAM_SIZE=${LD_RAM_SIZE}
9396
"LINKER:--script=${LD_FILE_GNU}"

hw/bsp/ch58x/family.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@ CFLAGS += \
2424
-DFREQ_SYS=60000000 \
2525
-DDISK_LIB_ENABLE=0 \
2626
-DINT_SOFT \
27-
28-
CFLAGS += -Wno-error=strict-prototypes
27+
-Wno-error=strict-prototypes
2928

3029
LDFLAGS_GCC += \
31-
-nostdlib -nostartfiles \
32-
--specs=nosys.specs \
30+
-nostartfiles \
31+
--specs=nosys.specs --specs=nano.specs \
32+
33+
LIBS += $(TOP)/$(SDK_SRC_DIR)/StdPeriphDriver/libISP583.a
3334

3435
SRC_C += \
3536
src/portable/wch/dcd_ch58x_usbfs.c \

0 commit comments

Comments
 (0)