Downloaded this: https://github.com/espressif/idf-extra-components/tree/master/usb/esp_tinyusb directory an placed it into componenets. Now its components/esp_tinyusb
ran pio run -t clean
ran pio run
What happened:
PIO created a new subdirectory named managed_components that contains espressif__tinyusb. It then ignores the version in components and issues this error:
Reading CMake configuration...
-- git rev-parse returned 'fatal: not a git repository (or any of the parent directories): .git'
-- Building ESP-IDF components for target esp32s3
Processing 2 dependencies:
[1/2] espressif/tinyusb (0.15.0~5)
[2/2] idf (5.1.2)
-- Configuring incomplete, errors occurred!
See also "/home/epoulsen/workspaces/dragonfly-supervisor/firmware/.pio/build/esp32dev/CMakeFiles/CMakeOutput.log".
fatal: not a git repository (or any of the parent directories): .git
CMake Error at /home/epoulsen/.platformio/packages/framework-espidf/tools/cmake/component.cmake:250 (message):
ERROR: 2 problems were found in the manifest file
/home/epoulsen/workspaces/dragonfly-supervisor/firmware/managed_components/espressif__tinyusb/idf_component.yml:
Invalid manifest format
Unknown targets: esp32p4
SUGGESTION: This component may be using a newer version of the component
manager.
You can try to update the component manager by running:
/home/epoulsen/.platformio/penv/.espidf-5.1.2/bin/python -m pip install --upgrade idf-component-manager
Call Stack (most recent call first):
/home/epoulsen/.platformio/packages/framework-espidf/tools/cmake/build.cmake:574 (__component_get_requirements)
/home/epoulsen/.platformio/packages/framework-espidf/tools/cmake/project.cmake:547 (idf_build_process)
CMakeLists.txt:4 (project)
============================== [FAILED] Took 1.29 seconds ==============================
I can edit the idf_component.yml file to remove the reference to esp32p4, but then PIO complains that I changed a managed component, and that I move it to components
So, I remove my original components/esp_tinyusb and move the modified espressif__tinyusb there, only for my code to fail to compile because espressif__tinyusb does not contain the same code that I originally downloaded – it’s a different, incompatible version.
I’ve been through all the forum posts, and the IDF documentation.
Adding an IDF component seems to be an exercise in futility at this point. Is there anyone who has successfully added tinyusb (with the tinyusb_msc_storage_init_sdmmc function) to an IDF PIO project?
I don’t know if this is your case, but I was also having difficulty porting an ESP-IDF project to Arduino. And I ended up discovering that just disabling the IDF extension would stop what was happening, which was changing the icons in the bottom toolbar.
Apparently, the latest version of the tinyusb library added support for new ESP32 targets that are not yet supported in PlatformIO. As a workaround I’d recommend locking the tinyusb version in components/esp_tinyusb/idf_component.yml to ==0.15.0~3.
When this is present, however, Platformio core is creating managed_components and placing a different version of the code in a directory named espressif__tinyusb that does specify esp32p4.
The issue isn’t that esp32p4 exists there. The issue is that PIO is seeing an unmanaged component, and it’s triggering PIO to download/create a managed component that is causing this error.
Having said that, even if I do force the version in components/esp_tinyusb/idf_components.yml to be 0.15.0~3, PIO will still download an incompatible version into managed_components which then fails to link because that version does not contain tinyusb_msc_storage_init_sdmmc.
On second thought, maybe the issue is not the library version, but the version of the idf-component-manager package that’s not aware of the new targets. This should be fixed in the development branch, so it would be great if you could test it out with your project. Just revert changes to your initial state described in the first message and pull your platform directly from the repository, for example:
However the issue of ignoring the code in the components directory and installing an incompatible version of the USB code in managed_components still persists.
The PIO documentation WRT IDF components needs to spell out how to do this. As it is, no amount of searching PIO docs, forums, IDF docs, has yielded anything that actually works.
What is your current platformio.ini? The ESP32S3 example with TinyUSB in my repo definitely works, it is checked by Github Actions CI to compile properly.