Using tinyusb from a component
Posted: Sat Apr 22, 2023 2:23 pm
ESP-IDF 5.0.1
Windows 11
I can create a fairly trivial project using tinyusb that creates two cdc-acm serial ports and echoes output from each in the other (test.zip).
However if I try to move usb.c and usb.h into a component I can't get the system to build.
In the first instance i just moved usb.c and usb.h to components\usb
created components\usb\CmakeLists.txt
and updated main\CMakeLists.txt
Attempting to build now produces the following errors
The first can be fixed by adding a REQUIRES line to components\usb\CMakeLists.txt
However, I can find no way to eliminate the second error.
I've tried moving idf_components.yml to various other parts of the project to no avail.
test1.zip is my latest component version
Anybody know how to get rid of this error please
Windows 11
I can create a fairly trivial project using tinyusb that creates two cdc-acm serial ports and echoes output from each in the other (test.zip).
However if I try to move usb.c and usb.h into a component I can't get the system to build.
In the first instance i just moved usb.c and usb.h to components\usb
created components\usb\CmakeLists.txt
Code: Select all
idf_component_register(
SRCS "usb.c"
INCLUDE_DIRS "."
)
Code: Select all
# See the build system documentation in IDF programming guide
# for more information about component CMakeLists.txt files.
idf_component_register([attachment=1]test.zip[/attachment]
SRCS main.c
REQUIRES usb
)
Code: Select all
<path>/eclipse-workspace/test1/components/usb/usb.c:6:10: fatal error: tinyusb.h: No such file or directory
6 | #include "tinyusb.h"
| ^~~~~~~~~~~
compilation terminated.
<path>/eclipse-workspace/test1/managed_components/espressif__esp_tinyusb/tinyusb.c:12:10: fatal error: esp_private/usb_phy.h: No such file or directory
12 | #include "esp_private/usb_phy.h"
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Code: Select all
idf_component_register(
SRCS "usb.c"
INCLUDE_DIRS "."
REQUIRES tinyusb
)
I've tried moving idf_components.yml to various other parts of the project to no avail.
test1.zip is my latest component version
Anybody know how to get rid of this error please