Errors with Arduino as ESP-IDF Component or HybridCompile for my ESP32S2 USB Project

Hello,

so for the past days i have nonstop failed at getting this project working, i have reached full desperation. Here is whats going on:

  • I have a full working framework=arduino project with platform=pioarduino that uses OTA via USBMSC.
  • I want to add flash-encryption. From my research that means ESP-IDF needs to step in. Either as a framwork=arduino,espidf (arduino as esp-idf component) or a HybridCompile (which i guess is actived via custom_sdkconfig = … in platformio.ini, correct me if im wrong)

Either way i get a multitude of errors regarding tinyusb, ranging from tusb.h not found, USBSerial not found to ‘tinyusb_add_string_descriptor’ was not declared.

What ive done:

  1. Added Tinyusb as yml dependency (bc epsidf v5.5.4 doesn include it anymore (breaks because then there are two tinyusb in the project i believe)
  2. custom_component_remove = arduino_tinyusb (not working, its a critial component
  3. Probably all possible combinations of build_flags, build_unflags, #defines and skdconfig.defaults.
  4. adding arduino_espressive32 into the /components folder.
  5. rewriting my USBMSC OTA script to only use esp-idf syntax
  6. switches platform=pioarduino to espressif32

I dont know any further…

What i want to know is: Is this currently possible? Are there know working repos? Does someone has a underlying understanding of this an could assit in the project setup? Im all out of ideas.

Thanks for your time,
Peter

If you have a minimal failing compile with these USB components, report them to https://github.com/pioarduino/platform-espressif32/issues/ with the exact project files.