#1471·FastLED

FastLED and Arduino TinyUSB issues on RP2040

Author: solidDoWantCreated Feb 2, 2023Updated Sep 11, 2026
Labelsstatus: triageplatform: rp2040area: core

Hello! I have a strange issue when using both FastLED and the Arduino TinyUSB port on a Raspberry Pi Pico (RP2040). When including both the FastLED and TinyUSB library some LEDs attached will be a random color. They are usually towards the beginning of the string, but occasionally will be a few (I'm guessing 3-7) LEDs in. Here's a pic of the issue: image

The strings having the issue, the position of the wrong color LEDs, and what colors they are varies update (show call) to update, as well as unrelated changes to code. For example, if I add a dead simple counter (uint8_t counter = 0; in a global scope, and counter++; every update loop, the color, position, strip, and frequency of the issue may change.

I have tested the following to verify that the hardware is not the issue:

  • Swapped out MCU boards (Raspbery Pi Picos all bought from Digi-Key sealed in cut tape)
  • Tried with and without a level shifter, multiple models
  • With and without the "breakout" PCB I built
  • Tried other LED strips from multiple manufacturers and lengths
  • Used other controllers from various manufacturers

Here's some example code demonstrating the issue:

#include <FastLED.h>
#include <Adafruit_TinyUSB.h>

#define LED_COUNT 35

CRGB ChannelLEDs[LED_COUNT];
void setup() {
  FastLED.addLeds<WS2812B, 0, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 1, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 2, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 3, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 4, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 5, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 6, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 7, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 8, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 9, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 10, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 11, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 12, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 13, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 14, GRB>(ChannelLEDs, 0, LED_COUNT);
  FastLED.addLeds<WS2812B, 15, GRB>(ChannelLEDs, 0, LED_COUNT);
  fill_solid(ChannelLEDs, LED_COUNT, CRGB::Red);
}

void loop() {
  FastLED.show();
}

If you comment out the #include <Adafruit_TinyUSB.h> line the issue goes away.

Note that I'm using the same CRGB array for all controllers, but the issue happens whether or not I use the same array for all of them. The color is arbitrary too - I can even turn all the LEDs off (set color to black) and I will still have the issue. image

Any idea what what the issue could be? I am guessing that both the libraries use the same hardware resource for something, but I have no idea where to start looking.