cherry-embedded / CherryDAP

CherryDAP is a DAPLink template based on CherryUSB and ARMmbed DAPLink.
https://cherrydap.cherry-embedded.org/
Apache License 2.0
146 stars 48 forks source link

编译过程出错 #1

Closed seakr closed 1 year ago

seakr commented 1 year ago

编译产生了3种类型的错误:

  1. section .nocache_noinit_ram_region' will not fit in regionnocache_ram_memory'
  2. region `nocache_ram_memory' overflowed by 21520 bytes
  3. undefined reference to `usbd_ep_start_read'

关于第三个类型的错误,我在.map文件中能找到这个 usbd_ep_start_read build_out/lib/libcherryusb.a(usbd_core.c.o)

我该如何解决呢? 编译产生的日志如下:

$ make 
/home/seakr/CODE/bouffalo_sdk/tools/cmake/bin/cmake -S . -B build -G "Unix Makefiles" -DCROSS_COMPILE=riscv64-unknown-elf- -DCHIP=bl616 -DCPU_ID= -DBOARD=bl616dk -DBOARD_DIR= -DCONFIG_DEBUG=y -DCONFIG_ROMAPI=y -DCONFIG_USB_HS=y -DCONFIG_COMX=COM5 -DCMAKE_EXPORT_COMPILE_COMMANDS=OFF -DCONFIG_TLSF=y -DCONFIG_COREDUMP=y

-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/toolchain_gcc_t-head_linux/bin/riscv64-unknown-elf-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/toolchain_gcc_t-head_linux/bin/riscv64-unknown-elf-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/toolchain_gcc_t-head_linux/bin/riscv64-unknown-elf-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- [register library : libc], path:/home/seakr/CODE/bouffalo_sdk/components/libc
-- [register library : mm], path:/home/seakr/CODE/bouffalo_sdk/components/mm
-- [register library : utils], path:/home/seakr/CODE/bouffalo_sdk/components/utils
-- [register library : lhal], path:/home/seakr/CODE/bouffalo_sdk/drivers/lhal
-- [register extern library : libcsi_xt900p32f_dsp], path:/home/seakr/CODE/bouffalo_sdk/drivers/lhal
-- [register extern library : libpka], path:/home/seakr/CODE/bouffalo_sdk/drivers/lhal
-- [register library : std], path:/home/seakr/CODE/bouffalo_sdk/drivers/soc/bl616/std
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CONFIG_COMX
    CONFIG_USB_HS

-- Build files have been written to: /home/seakr/CODE/CherryDAP/projects/bl616/build
make -C build -j8
[  1%] Building C object CherryUSB/CMakeFiles/cherryusb.dir/core/usbd_core.c.o
[  2%] Building C object CherryUSB/CMakeFiles/cherryusb.dir/class/cdc/usbd_cdc.c.o
[  2%] Building C object build_out/components/utils/CMakeFiles/utils.dir/log/log.c.o
[  3%] Building C object build_out/components/mm/CMakeFiles/mm.dir/mem.c.o
[  3%] Building C object build_out/components/mm/CMakeFiles/mm.dir/tlsf/tlsf.c.o
[  4%] Building ASM object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/startup/start.S.o
[  4%] Building C object build_out/components/libc/CMakeFiles/libc.dir/newlib/port_memory.c.o
[  5%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_common.c.o
[  5%] Building ASM object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/startup/vector.S.o
[  6%] Building C object build_out/components/utils/CMakeFiles/utils.dir/ring_buffer/ring_buffer.c.o
[  7%] Building ASM object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/startup/riscv_fpu.S.o
/home/seakr/CODE/CherryDAP/CherryUSB/class/cdc/usbd_cdc.c: In function 'cdc_acm_class_interface_request_handler':
/home/seakr/CODE/CherryDAP/CherryUSB/class/cdc/usbd_cdc.c:19:28: warning: unused variable 'line_coding_last' [-Wunused-variable]
   19 |     struct cdc_line_coding line_coding_last;
      |                            ^~~~~~~~~~~~~~~~
[  8%] Building C object build_out/components/libc/CMakeFiles/libc.dir/newlib/syscalls_nosys.c.o
[  9%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/startup/start_load.c.o
[ 10%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_abs.c.o
[ 11%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_adc.c.o
[ 12%] Building C object build_out/components/mm/CMakeFiles/mm.dir/tlsf/bflb_tlsf.c.o
[ 12%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/startup/system_bl616.c.o
[ 13%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/startup/interrupt.c.o
[ 13%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_atof.c.o
[ 13%] Linking C static library ../build_out/lib/libcherryusb.a
[ 14%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_romapi_e907.c.o
[ 15%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_atoi.c.o
[ 16%] Building C object build_out/components/utils/CMakeFiles/utils.dir/bflb_block_pool/bflb_block_pool.c.o
[ 17%] Building C object build_out/components/utils/CMakeFiles/utils.dir/bflb_timestamp/bflb_timestamp.c.o
[ 18%] Linking C static library ../../lib/libmm.a
[ 18%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_acomp.c.o
[ 18%] Built target cherryusb
[ 19%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_romapi_patch.c.o
[ 20%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_atol.c.o
[ 20%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_clock.c.o
[ 20%] Building C object build_out/components/utils/CMakeFiles/utils.dir/getopt/utils_getopt.c.o
[ 20%] Built target mm
[ 21%] Building C object build_out/components/utils/CMakeFiles/utils.dir/coredump/bflb_coredump.c.o
[ 22%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_cks.c.o
[ 23%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_ef_ctrl.c.o
[ 24%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_atoll.c.o
[ 25%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_gpio.c.o
[ 25%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_bsearch.c.o
[ 26%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_checkbase.c.o
[ 27%] Building C object build_out/components/utils/CMakeFiles/utils.dir/cjson/cJSON.c.o
[ 27%] Building C object build_out/components/utils/CMakeFiles/utils.dir/math/src/utils_base64.c.o
[ 28%] Building C object build_out/components/utils/CMakeFiles/utils.dir/math/src/utils_crc.c.o
[ 29%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_itoa.c.o
[ 29%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_i2c.c.o
[ 29%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_llabs.c.o
[ 30%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_common.c.o
[ 31%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_ef_cfg.c.o
[ 32%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_lldiv.c.o
[ 33%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_qsort.c.o
[ 34%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_dma.c.o
[ 35%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_rtc.c.o
[ 35%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_sec_aes.c.o
[ 36%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/stdlib/lib_strtod.c.o
[ 36%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_ffs.c.o
[ 37%] Building C object build_out/components/utils/CMakeFiles/utils.dir/math/src/utils_hex.c.o
[ 37%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_sdh.c.o
[ 38%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_tzc_sec.c.o
[ 39%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_psram.c.o
[ 40%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_pm.c.o
[ 41%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_ffsl.c.o
[ 41%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/src/bl616_aon.c.o
[ 42%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_sec_sha.c.o
[ 43%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_ffsll.c.o
[ 44%] Linking C static library ../../lib/libutils.a
[ 44%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_fls.c.o
[ 45%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_flsl.c.o
[ 46%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_flsll.c.o
[ 47%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_sec_trng.c.o
[ 48%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_index.c.o
[ 48%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_memccpy.c.o
[ 49%] Building C object build_out/drivers/soc/bl616/std/CMakeFiles/std.dir/port/bl616_clock.c.o
[ 50%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_memchr.c.o
[ 51%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_spi.c.o
[ 51%] Built target utils
[ 52%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_memcmp.c.o
[ 52%] Building C object CMakeFiles/app.dir/home/seakr/CODE/bouffalo_sdk/bsp/board/bl616dk/board.c.o
[ 53%] Building C object CMakeFiles/app.dir/home/seakr/CODE/bouffalo_sdk/bsp/board/bl616dk/fw_header.c.o
[ 54%] Building C object CMakeFiles/app.dir/usb2uart.c.o
[ 54%] Building C object CMakeFiles/app.dir/home/seakr/CODE/CherryDAP/dap_main.c.o
[ 55%] Building C object CMakeFiles/app.dir/home/seakr/CODE/CherryDAP/DAP/Source/DAP_vendor.c.o
[ 55%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_memmove.c.o
[ 56%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_memrchr.c.o
/home/seakr/CODE/CherryDAP/dap_main.c:436:18: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  436 |     .compat_id = USBD_WinUSBDescriptorSetDescriptor,
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/seakr/CODE/CherryDAP/dap_main.c:441:15: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
  441 |     .string = USBD_BinaryObjectStoreDescriptor,
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 56%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_timer.c.o
[ 57%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_uart.c.o
[ 59%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_wdg.c.o
[ 59%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_memset.c.o
[ 60%] Linking C static library ../../../../lib/libstd.a
[ 61%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_stpcpy.c.o
[ 62%] Building C object CMakeFiles/app.dir/home/seakr/CODE/CherryDAP/DAP/Source/DAP.c.o
[ 63%] Building C object CMakeFiles/app.dir/home/seakr/CODE/CherryDAP/DAP/Source/JTAG_DP.c.o
[ 63%] Building C object CMakeFiles/app.dir/home/seakr/CODE/CherryDAP/DAP/Source/SW_DP.c.o
[ 63%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_stpncpy.c.o
[ 64%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strcasecmp.c.o
/home/seakr/CODE/CherryDAP/DAP/Source/DAP.c: In function 'DAP_SWJ_Clock':
/home/seakr/CODE/CherryDAP/DAP/Source/DAP.c:408:12: warning: unused variable 'delay' [-Wunused-variable]
  408 |   uint32_t delay;
      |            ^~~~~
[ 65%] Building C object CMakeFiles/app.dir/home/seakr/CODE/CherryDAP/CherryRB/chry_ringbuffer.c.o
[ 65%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_flash.c.o
[ 66%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/flash/bflb_sf_cfg.c.o
[ 67%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strcasestr.c.o
[ 67%] Built target std
[ 67%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strcat.c.o
[ 68%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/flash/bflb_xip_sflash.c.o
[ 69%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/flash/bflb_sflash.c.o
[ 69%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/flash/bflb_sf_ctrl.c.o
[ 70%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_dac.c.o
[ 71%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strchr.c.o
[ 72%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_emac.c.o
[ 72%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_ir.c.o
[ 73%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strcmp.c.o
[ 74%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_mjpeg.c.o
[ 75%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_pwm_v2.c.o
[ 76%] Linking C static library build_out/lib/libapp.a
[ 77%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strcspn.c.o
[ 78%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_cam.c.o
[ 78%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strdup.c.o
[ 78%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_sdio2.c.o
[ 79%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_i2s.c.o
[ 80%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_dbi.c.o
[ 81%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strnlen.c.o
[ 81%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_audac.c.o
[ 82%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_auadc.c.o
[ 83%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_platform_dma.c.o
[ 83%] Built target app
[ 84%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strpbrk.c.o
[ 84%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strrchr.c.o
[ 85%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_wo.c.o
[ 85%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_irq.c.o
[ 86%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_l1c.c.o
[ 87%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/src/bflb_mtimer.c.o
[ 87%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/include/arch/risc-v/t-head/rv_hart.c.o
[ 88%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/include/arch/risc-v/t-head/rv_pmp.c.o
[ 89%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strsep.c.o
[ 90%] Building C object build_out/drivers/lhal/CMakeFiles/lhal.dir/config/bl616/device_table.c.o
[ 91%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strspn.c.o
[ 92%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strstr.c.o
[ 92%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strtok.c.o
[ 93%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_strtokr.c.o
[ 94%] Building C object build_out/components/libc/CMakeFiles/libc.dir/nuttx/libc/string/lib_vikmemcpy.c.o
[ 94%] Building C object build_out/components/libc/CMakeFiles/libc.dir/vsnprintf.c.o
[ 95%] Building C object build_out/components/libc/CMakeFiles/libc.dir/snprintf.c.o
[ 96%] Linking C static library ../../lib/liblhal.a
[ 97%] Building C object build_out/components/libc/CMakeFiles/libc.dir/sprintf.c.o
[ 98%] Building C object build_out/components/libc/CMakeFiles/libc.dir/vsprintf.c.o
[ 98%] Building C object build_out/components/libc/CMakeFiles/libc.dir/printf.c.o
[ 98%] Built target lhal
[ 99%] Linking C static library ../../lib/liblibc.a
[ 99%] Built target libc
[ 99%] Building C object CMakeFiles/cherrydap_bl616.elf.dir/main.c.o
[100%] Linking C executable build_out/cherrydap_bl616.elf
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/cherrydap_bl616.elf section `.nocache_noinit_ram_region' will not fit in region `nocache_ram_memory'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: region `nocache_ram_memory' overflowed by 21520 bytes
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libapp.a(dap_main.c.o): in function `dap_out_callback':
/home/seakr/CODE/CherryDAP/dap_main.c:330: undefined reference to `usbd_ep_start_read'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libapp.a(dap_main.c.o): in function `dap_in_callback':
/home/seakr/CODE/CherryDAP/dap_main.c:340: undefined reference to `usbd_ep_start_write'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libapp.a(dap_main.c.o): in function `usbd_cdc_acm_bulk_out':
/home/seakr/CODE/CherryDAP/dap_main.c:359: undefined reference to `usbd_ep_start_read'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libapp.a(dap_main.c.o): in function `usbd_cdc_acm_bulk_in':
/home/seakr/CODE/CherryDAP/dap_main.c:378: undefined reference to `usbd_ep_start_write'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /home/seakr/CODE/CherryDAP/dap_main.c:372: undefined reference to `usbd_ep_start_write'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libapp.a(dap_main.c.o): in function `usbd_event_handler':
/home/seakr/CODE/CherryDAP/dap_main.c:297: undefined reference to `usbd_ep_start_read'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /home/seakr/CODE/CherryDAP/dap_main.c:300: undefined reference to `usbd_ep_start_read'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libapp.a(dap_main.c.o): in function `chry_dap_handle':
/home/seakr/CODE/CherryDAP/dap_main.c:513: undefined reference to `usbd_ep_start_read'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /home/seakr/CODE/CherryDAP/dap_main.c:529: undefined reference to `usbd_ep_start_write'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libapp.a(dap_main.c.o): in function `chry_dap_usb2uart_handle':
/home/seakr/CODE/CherryDAP/dap_main.c:619: undefined reference to `usbd_ep_start_read'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /home/seakr/CODE/CherryDAP/dap_main.c:584: undefined reference to `usbd_ep_start_write'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libcherryusb.a(usbd_core.c.o): in function `usbd_event_ep0_in_complete_handler':
/home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:1098: undefined reference to `usbd_ep_start_write'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:1092: undefined reference to `usbd_ep_start_write'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:1107: undefined reference to `usbd_ep_start_read'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libcherryusb.a(usbd_core.c.o): in function `usbd_initialize':
/home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:1295: undefined reference to `usb_dc_init'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libcherryusb.a(usbd_core.c.o): in function `usbd_set_endpoint':
/home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:115: undefined reference to `usbd_ep_open'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:118: undefined reference to `usbd_ep_set_stall'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libcherryusb.a(usbd_core.c.o): in function `usbd_std_device_req_handler':
/home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:562: undefined reference to `usbd_ep_clear_stall'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libcherryusb.a(usbd_core.c.o): in function `usbd_set_configuration':
/home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:394: undefined reference to `usbd_set_address'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libcherryusb.a(usbd_core.c.o): in function `usbd_class_event_notify_handler':
/home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:963: undefined reference to `usbd_ep_close'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libcherryusb.a(usbd_core.c.o): in function `usbd_reset_endpoint':
/home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:144: undefined reference to `usbd_ep_open'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libcherryusb.a(usbd_core.c.o): in function `usbd_event_ep0_out_complete_handler':
/home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:339: undefined reference to `usbd_ep_start_write'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: build_out/lib/libcherryusb.a(usbd_core.c.o): in function `usbd_get_descriptor':
/home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:349: undefined reference to `usbd_ep_start_read'
/usr/bin/toolchain_gcc_t-head_linux/bin/../lib/gcc/riscv64-unknown-elf/10.2.0/../../../../riscv64-unknown-elf/bin/ld: /home/seakr/CODE/CherryDAP/CherryUSB/core/usbd_core.c:296: undefined reference to `usbd_ep_set_stall'
collect2: error: ld returned 1 exit status
make[3]: *** [CMakeFiles/cherrydap_bl616.elf.dir/build.make:107: build_out/cherrydap_bl616.elf] Error 1
make[2]: *** [CMakeFiles/Makefile2:515: CMakeFiles/cherrydap_bl616.elf.dir/all] Error 2
make[1]: *** [Makefile:91: all] Error 2
make: *** [/home/seakr/CODE/bouffalo_sdk/project.build:75: build] Error 2
sakumisu commented 1 year ago

自己修改 ld 和使能 bflb_usb_v2.c

sakumisu commented 1 year ago

既然你都知道错误了,应该要学会修改,不可能仓库随着官方的sdk变动,就要更新的,多谢。

sakumisu commented 1 year ago

比如 出错的 undefined,你应该第一时间知道,是某个没有文件没有参与编译,从而找到 bflb_usb_v2.c 并删除 该文件中的 if(CONFIG_CHERRYUSB) , ld如果不会修改,就放弃吧

if(CONFIG_CHERRYUSB)
if("${CHIP}" STREQUAL "bl702")
sdk_library_add_sources(src/bflb_usb_v1.c)
elseif(("${CHIP}" STREQUAL "bl602") OR ("${CHIP}" STREQUAL "bl702l"))
# no usb
elseif(("${CHIP}" STREQUAL "bl628"))
else()
sdk_library_add_sources(src/bflb_usb_v2.c)
endif()
endif()