Closed xtrinch closed 1 year ago
You have to clone (not recursive!) this repo https://github.com/hathach/tinyusb in .../components/ to get a working Arduino tinyusb See. You can adopt this example https://github.com/platformio/platform-espressif32/tree/develop/examples/arduino-usb-keyboard In short it is not possible as example since the needed component tinyusb (Arduino) is not included in standard IDF!
Could you please be more specific as to where I need to clone tinyusb to? What is the path of “.../components“? Do I need to find internally where platformio installs the esp32-arduino-lib-builder?
Platformio does not install "Arduino Lib Builder". The libs for the Arduino framework are compiled with https://github.com/espressif/esp32-arduino-lib-builder With this script https://github.com/espressif/esp32-arduino-lib-builder/blob/master/tools/update-components.sh the needed additional components needed for Arduino are added to compile the complete Arduino components with IDF.
So easiest is to clone the Arduino Lib Builder run the Builder one time and you have everything you need to copy in folder components/Arduino
So I compiled with the lib builder, and copied ${esp32-arduino-lib-builder_home}/components/arduino
and ${esp32-arduino-lib-builder_home}/components/arduino_tinyusb
into the project directory (under ${my_project_dir_home}/components/*
), but the error messages remain the same.
EDIT: I also tried removing arduino from framework = espidf, arduino
from platformio.ini, and now I get a different set of errors:
Reading CMake configuration...
-- Found Git: /usr/bin/git (found version "2.34.1")
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/xtrinch/.platformio/packages/toolchain-xtensa-esp32s2@8.4.0+2021r2-patch3/bin/xtensa-esp32s2-elf-gcc
-- Check for working C compiler: /home/xtrinch/.platformio/packages/toolchain-xtensa-esp32s2@8.4.0+2021r2-patch3/bin/xtensa-esp32s2-elf-gcc
-- Check for working C compiler: /home/xtrinch/.platformio/packages/toolchain-xtensa-esp32s2@8.4.0+2021r2-patch3/bin/xtensa-esp32s2-elf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/xtrinch/.platformio/packages/toolchain-xtensa-esp32s2@8.4.0+2021r2-patch3/bin/xtensa-esp32s2-elf-g++
-- Check for working CXX compiler: /home/xtrinch/.platformio/packages/toolchain-xtensa-esp32s2@8.4.0+2021r2-patch3/bin/xtensa-esp32s2-elf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32s2
-- Configuring incomplete, errors occurred!
See also "/home/xtrinch/repos/platform-espressif32/examples/espidf-peripherals-usb/.pio/build/esp32-s2-saola-1/CMakeFiles/CMakeOutput.log".
fatal: not a git repository (or any of the parent directories): .git
CMake Error at /home/xtrinch/.platformio/packages/framework-espidf/tools/cmake/build.cmake:201 (message):
Failed to resolve component 'main'.
Call Stack (most recent call first):
/home/xtrinch/.platformio/packages/framework-espidf/tools/cmake/build.cmake:232 (__build_resolve_and_add_req)
/home/xtrinch/.platformio/packages/framework-espidf/tools/cmake/build.cmake:509 (__build_expand_requirements)
/home/xtrinch/.platformio/packages/framework-espidf/tools/cmake/project.cmake:384 (idf_build_process)
CMakeLists.txt:6 (project)
You can not use a esp idf programm and compile it without changes together with Arduino components. You have to adopt (add) code parts. See the Idf/Arduino examples
And yes you have to specify only framework = espidf
since you have already added the Arduino code parts in components
This issue has been automatically marked as stale because it has not had recent activity. Please provide more details or it will be closed if no further activity occurs. Thank you for your contributions.
Hello,
I've been wondering if it's at all possible to use arduino as component when using tinyusb.
I've tried adding arduino to https://github.com/platformio/platform-espressif32/tree/develop/examples/espidf-peripherals-usb, but the project does not compile and fails with a bunch of errors. (And yes it compiles fine without adding arduino as component!)
It would be really nice to have an example project that does both usb and arduino as component.
Config:
Errors: