esp32 s2 tinyUSB

stareye
Posts: 2
Joined: Sat Aug 22, 2020 8:51 am

Re: esp32 s2 tinyUSB

Postby stareye » Sat Aug 22, 2020 9:07 am

chegewara wrote:
Thu Aug 20, 2020 8:07 am
Today i would like to share good news. I have first on the world (or maybe not) working ESP32 S2 pendrive that can read SD card over SPI.
Code is working with a bit changed arduino-esp32 and my library. Its not super speed, i would say it slow, yet, but it is working and can be read/write by OS (tested with linux) and still can be read/write by esp32 like usual.
Great news!!
Would it be possible to get your sample code? I'd like to do a couple of tests as well.

Thank you!

chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: esp32 s2 tinyUSB

Postby chegewara » Mon Aug 24, 2020 5:35 am

Here is sample app based on arduino SDWebServer example.You also need to apply patch to arduino-esp32.
Attachments
sdcard.patch.txt
(2.12 KiB) Downloaded 984 times
SDWebServer.zip
(7.49 KiB) Downloaded 955 times

stareye
Posts: 2
Joined: Sat Aug 22, 2020 8:51 am

Re: esp32 s2 tinyUSB

Postby stareye » Mon Aug 24, 2020 11:34 am

chegewara wrote:
Mon Aug 24, 2020 5:35 am
Here is sample app based on arduino SDWebServer example.You also need to apply patch to arduino-esp32.
Thank you!

adamwilt
Posts: 13
Joined: Sun Dec 06, 2020 1:54 am

Re: esp32 s2 tinyUSB

Postby adamwilt » Thu Feb 04, 2021 12:28 am

Trying to compile the tusb_sample_msc example, but all the tud_xxx_cb callbacks in msc_disk.c show up as undefined references during the link phase:
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.proc_builtin_scsi+0x14): undefined reference to `tud_msc_test_unit_ready_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.proc_builtin_scsi+0x18): undefined reference to `tud_msc_capacity_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.proc_builtin_scsi+0x20): undefined reference to `tud_msc_inquiry_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.proc_read10_cmd+0x4): undefined reference to `tud_msc_read10_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.mscd_xfer_cb+0x20): undefined reference to `tud_msc_scsi_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.mscd_xfer_cb+0x24): undefined reference to `tud_msc_write10_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj): in function `proc_builtin_scsi':
/Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:483: undefined reference to `tud_msc_test_unit_ready_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:516: undefined reference to `tud_msc_capacity_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:553: undefined reference to `tud_msc_capacity_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:588: undefined reference to `tud_msc_inquiry_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj): in function `proc_read10_cmd':
/Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:663: undefined reference to `tud_msc_read10_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj): in function `mscd_xfer_cb':
/Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:282: undefined reference to `tud_msc_scsi_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:324: undefined reference to `tud_msc_scsi_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:340: undefined reference to `tud_msc_write10_cb'
I've tried renaming projects and targets. I've put msc_disk.c into its own component, and REQUIREd its inclusion (and verified that libmsc_disk.a is being built and included in the link). I've #included <class/msc/msc_device.h> in my copy of msc_disk.c and verified that the method signatures match. No difference; I always get these undefined references.

This happens with a fresh copy of this clone of esp-idf, and also occurs when the sample code is built with esp-idf-master as of 2 Feb 2021.

How do I get these callbacks to be recognized by the linker?

chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: esp32 s2 tinyUSB

Postby chegewara » Thu Feb 04, 2021 1:13 pm

Its hard to say without more details how do you prepare and build project, which repository you are using etc.

Maybe you are missing msc_disk.c in CMakeLists.txt:
https://github.com/chegewara/esp-idf/bl ... eLists.txt

adamwilt
Posts: 13
Joined: Sun Dec 06, 2020 1:54 am

Re: esp32 s2 tinyUSB

Postby adamwilt » Thu Feb 04, 2021 7:24 pm

Its hard to say without more details how do you prepare and build project, which repository you are using etc.
Maybe you are missing msc_disk.c in CMakeLists.txt
Yes, that was my first thought; that would have been an easy fix! Sadly, I already have it included. I'm probably missing some simple option deep in menuconfig, or some compile-time flag (CONFIG_DONT_IGNORE_CALLBACKS_IN_USER_CODE, grin), but I can't figure out what it might be. One possibility is that the generated function signatures don't match those expected by the tinyusb code, but both the calling routines and msc_disk.c are C (not C++) and as far as I can tell the function names, return types, and parameter types all match up with what's expected.

initial prep: install all the prerequisites for esp-idf; confirm that I can build and run esp-idf examples; successfully integrate other components like libsmb (SMB client) and u8g2 (OLED display driver); develop and use new components for an IIC RTC module and an IIC photosensor. Projects are built using the esp-idf 4.x-style CMakeLists.txt workflow.

Repository: I'm using a fresh clone of espressif/esp-idf as of 2 Feb 2021, and just deleted and re-cloned it today, 4 Feb.

When I have both tusb_sample_msc.c and msc_disk.c in the main subdirectory (as in the original example), CMakeLists.txt looks like this:

Code: Select all

idf_component_register(SRCS "tusb_sample_msc.c"  "msc_disk.c"
                       INCLUDE_DIRS . ${COMPONENT_DIR})
I essentially cloned the chegewara/esp-idf repository, and ran idf.py build in the tusb_sample_msc directory.

I then separated out msc_disk into its own component, so I could verify that it was being built and included:

Code: Select all

tusb_sample_msc/
    CMakeLists.txt
    sdkconfig
    README.md
    main/
        CMakeLists.txt
        tusb_sample_msc.c
    components/
        msc_disk/
            CMakeLists.txt
            msc_disk.c
When I have tusb_sample_msc.c in main and msc_disk.c in components/msc_disk, main/CMakeLists.txt looks like this:

Code: Select all

idf_component_register(SRCS "tusb_sample_msc.c"
                       INCLUDE_DIRS . ${COMPONENT_DIR} 
                       REQUIRES msc_disk)
And components/msc_disk/CMakeLists.txt is:

Code: Select all

idf_component_register(SRCS "msc_disk.c"
                       INCLUDE_DIRS . ${COMPONENT_DIR}
                       REQUIRES tinyusb)
In the latter case, this is the output from the build command (references to libmsc_disk.a bolded, and I verified that libmsc_disk.a is present in build/esp-idf/msc_disk):
[7/8] Linking CXX executable tusb_sample_msc.elf
FAILED: tusb_sample_msc.elf
: && /Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-g++ -mlongcalls CMakeFiles/tusb_sample_msc.elf.dir/project_elf_src_esp32s2.c.obj -o tusb_sample_msc.elf esp-idf/esp_pm/libesp_pm.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/esp_ipc/libesp_ipc.a esp-idf/spi_flash/libspi_flash.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/pthread/libpthread.a esp-idf/esp_gdbstub/libesp_gdbstub.a esp-idf/esp_system/libesp_system.a esp-idf/esp_rom/libesp_rom.a esp-idf/hal/libhal.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/soc/libsoc.a esp-idf/esp_hw_support/libesp_hw_support.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/xtensa/libxtensa.a esp-idf/espcoredump/libespcoredump.a esp-idf/esp32s2/libesp32s2.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/asio/libasio.a esp-idf/cbor/libcbor.a esp-idf/unity/libunity.a esp-idf/cmock/libcmock.a esp-idf/coap/libcoap.a esp-idf/console/libconsole.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/esp_adc_cal/libesp_adc_cal.a esp-idf/esp_hid/libesp_hid.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/esp_https_ota/libesp_https_ota.a esp-idf/protobuf-c/libprotobuf-c.a esp-idf/protocomm/libprotocomm.a esp-idf/mdns/libmdns.a esp-idf/esp_local_ctrl/libesp_local_ctrl.a esp-idf/sdmmc/libsdmmc.a esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a esp-idf/esp_websocket_client/libesp_websocket_client.a esp-idf/expat/libexpat.a esp-idf/wear_levelling/libwear_levelling.a esp-idf/fatfs/libfatfs.a esp-idf/freemodbus/libfreemodbus.a esp-idf/jsmn/libjsmn.a esp-idf/json/libjson.a esp-idf/libsodium/liblibsodium.a esp-idf/mqtt/libmqtt.a esp-idf/openssl/libopenssl.a esp-idf/perfmon/libperfmon.a esp-idf/spiffs/libspiffs.a esp-idf/touch_element/libtouch_element.a esp-idf/ulp/libulp.a esp-idf/wifi_provisioning/libwifi_provisioning.a esp-idf/msc_disk/libmsc_disk.a esp-idf/main/libmain.a -Wl,--cref -Wl,--Map=/Users/adamwilt/Downloads/esp-idf-master/examples/peripherals/usb/tusb_sample_msc/build/tusb_sample_msc.map -fno-rtti -fno-lto esp-idf/unity/libunity.a esp-idf/wear_levelling/libwear_levelling.a esp-idf/protocomm/libprotocomm.a esp-idf/protobuf-c/libprotobuf-c.a esp-idf/mdns/libmdns.a esp-idf/console/libconsole.a esp-idf/json/libjson.a esp-idf/msc_disk/libmsc_disk.a esp-idf/tinyusb/libtinyusb.a esp-idf/esp_pm/libesp_pm.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/esp_ipc/libesp_ipc.a esp-idf/spi_flash/libspi_flash.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/pthread/libpthread.a esp-idf/esp_gdbstub/libesp_gdbstub.a esp-idf/esp_system/libesp_system.a esp-idf/esp_rom/libesp_rom.a esp-idf/hal/libhal.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/soc/libsoc.a esp-idf/esp_hw_support/libesp_hw_support.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/xtensa/libxtensa.a esp-idf/espcoredump/libespcoredump.a esp-idf/esp32s2/libesp32s2.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/esp_https_ota/libesp_https_ota.a esp-idf/sdmmc/libsdmmc.a esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a esp-idf/ulp/libulp.a esp-idf/mbedtls/mbedtls/library/libmbedtls.a esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a esp-idf/mbedtls/mbedtls/library/libmbedx509.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libcoexist.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libcore.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libespnow.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libmesh.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libnet80211.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libpp.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libsmartconfig.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libwapi.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libphy.a esp-idf/esp_pm/libesp_pm.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/esp_ipc/libesp_ipc.a esp-idf/spi_flash/libspi_flash.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/pthread/libpthread.a esp-idf/esp_gdbstub/libesp_gdbstub.a esp-idf/esp_system/libesp_system.a esp-idf/esp_rom/libesp_rom.a esp-idf/hal/libhal.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/soc/libsoc.a esp-idf/esp_hw_support/libesp_hw_support.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/xtensa/libxtensa.a esp-idf/espcoredump/libespcoredump.a esp-idf/esp32s2/libesp32s2.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/esp_https_ota/libesp_https_ota.a esp-idf/sdmmc/libsdmmc.a esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a esp-idf/ulp/libulp.a esp-idf/mbedtls/mbedtls/library/libmbedtls.a esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a esp-idf/mbedtls/mbedtls/library/libmbedx509.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libcoexist.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libcore.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libespnow.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libmesh.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libnet80211.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libpp.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libsmartconfig.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libwapi.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libphy.a esp-idf/esp_pm/libesp_pm.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/esp_ipc/libesp_ipc.a esp-idf/spi_flash/libspi_flash.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/pthread/libpthread.a esp-idf/esp_gdbstub/libesp_gdbstub.a esp-idf/esp_system/libesp_system.a esp-idf/esp_rom/libesp_rom.a esp-idf/hal/libhal.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/soc/libsoc.a esp-idf/esp_hw_support/libesp_hw_support.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/xtensa/libxtensa.a esp-idf/espcoredump/libespcoredump.a esp-idf/esp32s2/libesp32s2.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/esp_https_ota/libesp_https_ota.a esp-idf/sdmmc/libsdmmc.a esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a esp-idf/ulp/libulp.a esp-idf/mbedtls/mbedtls/library/libmbedtls.a esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a esp-idf/mbedtls/mbedtls/library/libmbedx509.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libcoexist.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libcore.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libespnow.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libmesh.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libnet80211.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libpp.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libsmartconfig.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libwapi.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libphy.a esp-idf/esp_pm/libesp_pm.a esp-idf/mbedtls/libmbedtls.a esp-idf/efuse/libefuse.a esp-idf/bootloader_support/libbootloader_support.a esp-idf/app_update/libapp_update.a esp-idf/esp_ipc/libesp_ipc.a esp-idf/spi_flash/libspi_flash.a esp-idf/nvs_flash/libnvs_flash.a esp-idf/pthread/libpthread.a esp-idf/esp_gdbstub/libesp_gdbstub.a esp-idf/esp_system/libesp_system.a esp-idf/esp_rom/libesp_rom.a esp-idf/hal/libhal.a esp-idf/vfs/libvfs.a esp-idf/esp_eth/libesp_eth.a esp-idf/tcpip_adapter/libtcpip_adapter.a esp-idf/esp_netif/libesp_netif.a esp-idf/esp_event/libesp_event.a esp-idf/wpa_supplicant/libwpa_supplicant.a esp-idf/esp_wifi/libesp_wifi.a esp-idf/lwip/liblwip.a esp-idf/log/liblog.a esp-idf/heap/libheap.a esp-idf/soc/libsoc.a esp-idf/esp_hw_support/libesp_hw_support.a esp-idf/esp_ringbuf/libesp_ringbuf.a esp-idf/driver/libdriver.a esp-idf/xtensa/libxtensa.a esp-idf/espcoredump/libespcoredump.a esp-idf/esp32s2/libesp32s2.a esp-idf/esp_common/libesp_common.a esp-idf/esp_timer/libesp_timer.a esp-idf/freertos/libfreertos.a esp-idf/newlib/libnewlib.a esp-idf/cxx/libcxx.a esp-idf/app_trace/libapp_trace.a esp-idf/nghttp/libnghttp.a esp-idf/esp-tls/libesp-tls.a esp-idf/tcp_transport/libtcp_transport.a esp-idf/esp_http_client/libesp_http_client.a esp-idf/esp_http_server/libesp_http_server.a esp-idf/esp_https_ota/libesp_https_ota.a esp-idf/sdmmc/libsdmmc.a esp-idf/esp_serial_slave_link/libesp_serial_slave_link.a esp-idf/ulp/libulp.a esp-idf/mbedtls/mbedtls/library/libmbedtls.a esp-idf/mbedtls/mbedtls/library/libmbedcrypto.a esp-idf/mbedtls/mbedtls/library/libmbedx509.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libcoexist.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libcore.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libespnow.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libmesh.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libnet80211.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libpp.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libsmartconfig.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libwapi.a /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2/libphy.a -Wl,--wrap=mbedtls_mpi_exp_mod -lesp32s2 -u esp_app_desc -u pthread_include_pthread_impl -u pthread_include_pthread_cond_impl -u pthread_include_pthread_local_storage_impl -u ld_include_panic_highint_hdl -u start_app -L /Users/adamwilt/esp/esp-idf/components/esp_rom/esp32s2/ld -T esp32s2.rom.ld -T esp32s2.rom.api.ld -T esp32s2.rom.libgcc.ld -T esp32s2.rom.newlib-funcs.ld -T esp32s2.rom.newlib-data.ld -T esp32s2.rom.spiflash.ld -u vfs_include_syscalls_impl -L /Users/adamwilt/esp/esp-idf/components/esp_wifi/lib/esp32s2 /Users/adamwilt/esp/esp-idf/components/xtensa/esp32s2/libxt_hal.a -L /Users/adamwilt/Downloads/esp-idf-master/examples/peripherals/usb/tusb_sample_msc/build/esp-idf/esp32s2 -T esp32s2_out.ld -L /Users/adamwilt/Downloads/esp-idf-master/examples/peripherals/usb/tusb_sample_msc/build/esp-idf/esp32s2/ld -T esp32s2.project.ld -L /Users/adamwilt/esp/esp-idf/components/esp32s2/ld -T esp32s2.peripherals.ld -u call_user_start_cpu0 -Wl,--gc-sections -Wl,--undefined=uxTopUsedPriority -u app_main -lm esp-idf/newlib/libnewlib.a -u newlib_include_heap_impl -u newlib_include_syscalls_impl -u newlib_include_pthread_impl -lgcc -u __cxa_guard_dummy -lstdc++ esp-idf/pthread/libpthread.a -u __cxx_fatal_exception esp-idf/app_trace/libapp_trace.a -lgcov esp-idf/app_trace/libapp_trace.a -lgcov -lc && :
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.proc_builtin_scsi+0x14): undefined reference to `tud_msc_test_unit_ready_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.proc_builtin_scsi+0x18): undefined reference to `tud_msc_capacity_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.proc_builtin_scsi+0x20): undefined reference to `tud_msc_inquiry_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.proc_read10_cmd+0x4): undefined reference to `tud_msc_read10_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.mscd_xfer_cb+0x20): undefined reference to `tud_msc_scsi_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj):(.literal.mscd_xfer_cb+0x24): undefined reference to `tud_msc_write10_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj): in function `proc_builtin_scsi':
/Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:483: undefined reference to `tud_msc_test_unit_ready_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:516: undefined reference to `tud_msc_capacity_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:553: undefined reference to `tud_msc_capacity_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:588: undefined reference to `tud_msc_inquiry_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj): in function `proc_read10_cmd':
/Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:663: undefined reference to `tud_msc_read10_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: esp-idf/tinyusb/libtinyusb.a(msc_device.c.obj): in function `mscd_xfer_cb':
/Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:282: undefined reference to `tud_msc_scsi_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:324: undefined reference to `tud_msc_scsi_cb'
/Users/adamwilt/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/../lib/gcc/xtensa-esp32s2-elf/8.4.0/../../../../xtensa-esp32s2-elf/bin/ld: /Users/adamwilt/esp/esp-idf/components/tinyusb/tinyusb/src/class/msc/msc_device.c:340: undefined reference to `tud_msc_write10_cb'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
adamwilt@macOS1015vm tusb_sample_msc %

chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: esp32 s2 tinyUSB

Postby chegewara » Thu Feb 04, 2021 8:00 pm

You cant separate msc_disk.c from tusb_sample_msc.c and make it a component i think, but i may be wrong, never been trying to do such thing.

adamwilt
Posts: 13
Joined: Sun Dec 06, 2020 1:54 am

Re: esp32 s2 tinyUSB

Postby adamwilt » Thu Feb 04, 2021 8:06 pm

Whether I separate it out into its own component or leave it bundled with tusb_sample_msc in libmain.a, the result is exactly the same set of undefined references. (And, FWIW, I have successfully taken files in my own projects' main folders and turned them into separate components, and it's always worked.)

chegewara
Posts: 2362
Joined: Wed Jun 14, 2017 9:00 pm

Re: esp32 s2 tinyUSB

Postby chegewara » Thu Feb 04, 2021 8:37 pm

I will try to test it again when i have some spare time. In mean time maybe try arduino library or example included in original tinyusb library.

Stellershime
Posts: 10
Joined: Thu Feb 04, 2021 8:55 pm

Re: esp32 s2 tinyUSB

Postby Stellershime » Thu Feb 04, 2021 9:11 pm

Today i would like to share good news. I have first on the world (or maybe not) working ESP32 S2 pendrive that can read SD card over SPI.
Code is working with a bit changed arduino-esp32 and my library. Its not super speed, i would say it slow, yet, but it is working and can be read/write by OS (tested with linux) and still can be read/write by esp32 like usual.
Do you have any coding examples that is just simply reading and writing text files to the SD card and then drag/dropping them through the usb without involving usbWeb? Or you do have any good headers on how I can implement that through the code that you already provided? Also, I'm having some trouble compiling the arduino-tinyusb library with the header files. Should I be including espressif/esp-idf and the arduino-esp32 branches as components?

Who is online

Users browsing this forum: No registered users and 53 guests