You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
RP2040: Adafruit_TinyUSB_Arduino compiled without USE_TINYUSB, so FastLED Pico sketches fail #1719
On RP2040 (Arduino-Pico 4.5.3), fbuild 2.5.44 selects and compiles the core's bundled Adafruit_TinyUSB_Arduino library even though TinyUSB is not the selected USB stack. The build then stops at the library's own guard:
Adafruit_TinyUSB_Arduino/src/arduino/Adafruit_TinyUSB_API.h:50:2: error: #error TinyUSB is not selected, please select it in "Tools->Menu->USB Stack"
This shows up now that #1670 is fixed: boot2 assembles on 2.5.44, and the build gets one step further. Thanks for that fix.
Reproduce
Windows 11, fbuild 2.5.44, FastLED 3.10.8 in lib/FastLED (a clone of the 3.10.8 tag).
A sketch with only #include <Arduino.h> builds (334,608 bytes of flash).
A sketch using only IRremote 4.7.1 from lib/ builds.
Likely cause
FastLED's Arduino SD backend includes <SD.h> and <SPI.h>, so the resolver selects the core's SD, SPI and LittleFS libraries. Arduino-Pico adds this block to the top of the sources of its standard libraries, for example libraries/SD/src/SD.cpp:
#ifdef USE_TINYUSB
// For Serial when selecting TinyUSB. ...
#include<Adafruit_TinyUSB.h>
#endif
SPI/src/SPI.cpp and LittleFS/src/LittleFS.cpp contain the same include. USE_TINYUSB is not defined for this environment. It appears that the reconciliation pass in fbuild-library-select, which re-walks each dependent library's full source set, follows that include without honoring the #ifdef. That would select Adafruit_TinyUSB_Arduino and compile all of its sources. #1606 fixed the same class of problem for Bluetooth-only libraries.
If that is right, any Pico sketch that pulls in SPI, SD or LittleFS should hit it, with or without FastLED. I have not built that smaller case.
Expected
Adafruit_TinyUSB_Arduino is selected only when USE_TINYUSB is defined (the TinyUSB USB-stack menu option), as in the Arduino IDE.
Found while rechecking the fbuild legs of Design Studio for FastLED after #1689.
Activity
docs(fbuild): trace the RP2040 TinyUSB failure and link FastLED/fbuil…
fix(rp2040): don't infer Adafruit_TinyUSB_Arduino unless USE_TINYUSB …
docs(fbuild): FastLED/fbuild#1719 and #1722 fixed on main, awaiting r…