Tinyusb and esp32-arduino-lib-builder

Does anyone have any experience using esp32-arduino-lib-builder to create a set of custom libraries? I was trying to build the libraries to see if I could get the emulated openth simulated networking functionality in the ESP32 QEMU simulator working. Unfortunately, I’m unable to even build the “base” unaltered libraries. Before beating my head against the wall, I figured it would be worth asking here to see if anyone had any suggestions. It appears to be a compilation failure in the tinyusb library being wrapped by the Arduino component. Errors are below.

Thanks,
Craig

[1400/1833] Building C object esp-idf/arduino_tinyusb/CMakeFiles/__idf_arduino_tinyusb.dir/src/dcd_dwc2.c.obj
FAILED: esp-idf/arduino_tinyusb/CMakeFiles/__idf_arduino_tinyusb.dir/src/dcd_dwc2.c.obj 
ccache /home/setera/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20240530/riscv32-esp-elf/bin/riscv32-esp-elf-gcc -DESP32_ARDUINO_LIB_BUILDER -DESP_PLATFORM -DIDF_VER=\"v5.3.3-784-g96567cb17b\" -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/build/config -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/include/freertos -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb/src -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb/hw/bsp -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb/src/device -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/tinyusb/src/portable/synopsys/dwc2 -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/newlib/platform_include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/freertos/config/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/freertos/config/include/freertos -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/freertos/config/riscv/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/riscv/include/freertos -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/freertos/esp_additions/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support/include/soc -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support/include/soc/esp32p4 -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support/dma/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support/ldo/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support/port/esp32p4/. -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support/port/esp32p4/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_hw_support/port/esp32p4/private_include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/heap/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/log/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/soc/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/soc/esp32p4 -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/soc/esp32p4/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/hal/platform_port/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/hal/esp32p4/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/hal/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_rom/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_rom/include/esp32p4 -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_rom/esp32p4 -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_common/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_system/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_system/port/soc -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_system/port/include/riscv -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_system/port/include/private -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/riscv/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/esp_timer/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/lwip/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/lwip/include/apps -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/lwip/include/apps/sntp -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/lwip/lwip/src/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/lwip/port/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/lwip/port/freertos/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/lwip/port/esp32xx/include -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/lwip/port/esp32xx/include/arch -I/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf/components/lwip/port/esp32xx/include/sys -march=rv32imafc_zicsr_zifencei_xesppie -mabi=ilp32f  -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -nostartfiles -Os -freorder-blocks -Wwrite-strings -fstack-protector -fmacro-prefix-map=/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder=. -fmacro-prefix-map=/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -std=gnu17 -Wno-old-style-declaration -DCFG_TUSB_MCU=OPT_MCU_ESP32P4 -DCFG_TUSB_DEBUG=0 -Wno-type-limits -MD -MT esp-idf/arduino_tinyusb/CMakeFiles/__idf_arduino_tinyusb.dir/src/dcd_dwc2.c.obj -MF esp-idf/arduino_tinyusb/CMakeFiles/__idf_arduino_tinyusb.dir/src/dcd_dwc2.c.obj.d -o esp-idf/arduino_tinyusb/CMakeFiles/__idf_arduino_tinyusb.dir/src/dcd_dwc2.c.obj -c /home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c: In function 'dma_device_enabled':
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:105:43: error: 'dwc2_regs_t' has no member named 'ghwcfg2_bm'; did you mean 'ghwcfg4_bm'?
  105 |   return CFG_TUD_DWC2_DMA_ENABLE && dwc2->ghwcfg2_bm.arch == GHWCFG2_ARCH_INTERNAL_DMA;
      |                                           ^~~~~~~~~~
      |                                           ghwcfg4_bm
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c: In function 'edpt_schedule_packets':
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:388:37: error: 'dwc2_regs_t' has no member named 'dsts_bm'; did you mean 'dsts'?
  388 |     const uint32_t odd_now = (dwc2->dsts_bm.frame_number & 1u);
      |                                     ^~~~~~~
      |                                     dsts
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c: In function 'dcd_init':
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:435:15: error: 'dwc2_regs_t' has no member named 'ghwcfg2_bm'; did you mean 'ghwcfg4_bm'?
  435 |     if (dwc2->ghwcfg2_bm.hs_phy_type == GHWCFG2_HSPHY_ULPI) {
      |               ^~~~~~~~~~
      |               ghwcfg4_bm
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c: In function 'handle_bus_reset':
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:47:43: error: 'dwc2_regs_t' has no member named 'ghwcfg2_bm'; did you mean 'ghwcfg4_bm'?
   47 |   #define DWC2_EP_COUNT(_dwc2)  ((_dwc2)->ghwcfg2_bm.num_dev_ep + 1)
      |                                           ^~~~~~~~~~
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:670:29: note: in expansion of macro 'DWC2_EP_COUNT'
  670 |   const uint8_t ep_count =  DWC2_EP_COUNT(dwc2);
      |                             ^~~~~~~~~~~~~
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:700:9: error: 'dwc2_regs_t' has no member named 'dcfg_bm'; did you mean 'dcfg'?
  700 |   dwc2->dcfg_bm.address = 0;
      |         ^~~~~~~
      |         dcfg
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c: In function 'handle_enum_done':
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:721:17: error: 'dwc2_regs_t' has no member named 'dsts_bm'; did you mean 'dsts'?
  721 |   switch (dwc2->dsts_bm.enum_speed) {
      |                 ^~~~~~~
      |                 dsts
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c: In function 'handle_rxflvl_irq':
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:766:43: error: 'dwc2_regs_t' has no member named 'grxstsp_bm'; did you mean 'grxstsp'?
  766 |   const dwc2_grxstsp_t grxstsp_bm = dwc2->grxstsp_bm;
      |                                           ^~~~~~~~~~
      |                                           grxstsp
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:807:37: error: 'dwc2_dep_t' has no member named 'tsiz_bm'; did you mean 'tsiz'?
  807 |           xfer->total_len -= epout->tsiz_bm.xfer_size;
      |                                     ^~~~~~~
      |                                     tsiz
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c: In function 'handle_epin_slave':
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:869:43: error: 'dwc2_dep_t' has no member named 'tsiz_bm'; did you mean 'tsiz'?
  869 |     const uint16_t remain_packets = epin->tsiz_bm.packet_count;
      |                                           ^~~~~~~
      |                                           tsiz
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:873:54: error: 'dwc2_dep_t' has no member named 'tsiz_bm'; did you mean 'tsiz'?
  873 |       const uint16_t remain_bytes = (uint16_t) epin->tsiz_bm.xfer_size;
      |                                                      ^~~~~~~
      |                                                      tsiz
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:892:15: error: 'dwc2_dep_t' has no member named 'tsiz_bm'; did you mean 'tsiz'?
  892 |     if (epin->tsiz_bm.xfer_size == 0) {
      |               ^~~~~~~
      |               tsiz
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c: In function 'handle_ep_irq':
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:47:43: error: 'dwc2_regs_t' has no member named 'ghwcfg2_bm'; did you mean 'ghwcfg4_bm'?
   47 |   #define DWC2_EP_COUNT(_dwc2)  ((_dwc2)->ghwcfg2_bm.num_dev_ep + 1)
      |                                           ^~~~~~~~~~
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:959:28: note: in expansion of macro 'DWC2_EP_COUNT'
  959 |   const uint8_t ep_count = DWC2_EP_COUNT(dwc2);
      |                            ^~~~~~~~~~~~~
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c: In function 'dma_device_enabled':
/home/setera/source/thirdparty/platformio/esp32-arduino-lib-builder/components/arduino_tinyusb/src/dcd_dwc2.c:106:1: error: control reaches end of non-void function [-Werror=return-type]
  106 | }
      | ^
cc1: some warnings being treated as errors