Hi, I’m trying to build a TinyUSB based example on a Adafruit Neopixel Trinkey, and make it work to be sure that I don’t find any other problems with a project I’m trying to develop.
The problem is I can’t get rid of an error with SPI.h when I try to build the code.
Hm okay, something is definitely wrong here. I can reproduce the error.
One part is that it wrongly includes the “USBHost” library from the Arduino core when compiling the TinyUSB library, but that can be fixed with lib_ignore = USBHost. (Not nice, yes.).
The other part is really that it does not properly see the #include <SPI.h> in Adafruit_USBH_Host.h. And this line has only been added recently.
I also see lots of warnings when PlatformIO’s LDF tries to figure out the dependencies:
Warning! Classic Pre Processor is used for `C:\Users\Max\temp\trinkey\.pio\libdeps\busylight\Adafruit TinyUSB Library\src\arduino\Adafruit_TinyUSB_API.cpp`, advanced has failed with `Incorrect number of arguments to `TU_CHECK_MCU'`
Warning! Classic Pre Processor is used for `C:\Users\Max\temp\trinkey\.pio\libdeps\busylight\Adafruit TinyUSB Library\src\arduino\Adafruit_USBD_CDC.cpp`, advanced has failed with `Incorrect number of arguments to `TU_CHECK_MCU'`
Warning! Classic Pre Processor is used for `C:\Users\Max\temp\trinkey\.pio\libdeps\busylight\Adafruit TinyUSB Library\src\arduino\Adafruit_USBD_Device.cpp`, advanced has failed with `Incorrect number of arguments to `TU_CHECK_MCU'`
Warning! Classic Pre Processor is used for `C:\Users\Max\temp\trinkey\.pio\libdeps\busylight\Adafruit TinyUSB Library\src\arduino\Adafruit_USBH_Host.cpp`, advanced has failed with `Incorrect number of arguments to `TU_CHECK_MCU'`
...
It really seems to fail to recognize what the TU_CHECK_MCU macro does and consequently fails to do proper detection.
One workaround would be to downgrade the TinyUSB library version before the SPI.h line was included. Especially if you don’t have a USB Host chip in your project (USB Device is unaffected.)
Hi @gianmarco-mameli, is there a reason why you need a specific version of the Adafruit TinyUSB Library library instead of the revision bundled with the framework package?
Hi @valeros, no not particularily. My project is an experiment, trying to convert a Pi Pico based project to work on a neopixel trinkey but seems kind of hard, so I’m thinking to give up.
Maybe I can try use the tinyusb stack without insert the specific lib dep in platformio.ini file, only with ‘-DUSE_TINYUSB’ flag?
Thanks
the build is not completing successfully but now I have some error about multiple definitions of some functions.
This is because in the H and C files are present redefinitions of builtin functions from TinyUSB.
I’m a little stucked, anyway I’ll give it another try next days