NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
digitalcircuit
 
Posts: 12
Joined: Wed Jan 09, 2019 11:31 pm

NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by digitalcircuit »

I recently bought a Feather SCORPIO to take control of the ARGB in my recent computer rebuild. Hardware-wise, everything seems to work, and it's fantastic! If someone wants, I'm happy to share the details (essentially: buy ARGB splitters and a SATA power cable, splice 'n solder it all up).

Unfortunately, I've run into a software/firmware issue where invoking the Adafruit NeoPXL8 library (regular and HDR) causes the USB serial connection to stop responding after a delay (15 seconds - 10+ minutes), including breaking the ability to software reset to bootloader mode. Asides from the dropped serial connection, the code continues to run without issue, and I'm able to use the hardware BOOT and RESET buttons to regain access to the SCORPIO, but this makes it difficult to do any computer control of the lights.

I've already filed an issue on the NeoPXL8 repository with sample code and details on how to recreate the issue:
https://github.com/adafruit/Adafruit_NeoPXL8/issues/8

As this appears to break with the default strandtest.ino, I'm posting here to see if anyone else has run into this issue.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by adafruit_support_mike »

I haven't heard any other reports of SCORPIO boards losing the Serial connection. At a guess, the LEDs are producing enough noise on the supply lines to make the connection glitch.

Try adding:

Code: Select all

    if ( ! Serial ) {
        Serial.begin( 115200 );
    }
in loop() and see if the board can restart the Serial connection on its own.

User avatar
digitalcircuit
 
Posts: 12
Joined: Wed Jan 09, 2019 11:31 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by digitalcircuit »

That is a good guess - I imagine the LEDs from the various PC parts are the cheapest they could get.

Unfortunately, the "!Serial" check inside loop() did not resolve the issue. I added a counter for every time Serial.begin was called, for debugging.

This also shows how long the USB serial connection persisted running the serial-only test - 47 hours! Even across several reboots and a motherboard BIOS upgrade (no full power off, hence it continuing):

Code: Select all

# Prior serial-only test, no NeoPXL8 at all
Seconds: 169463
Seconds: 169468

# Pressed "Upload" in Arduino IDE, board resets as expected
[tio 22:22:45] Disconnected
# strandtest with !Serial check
[tio 22:22:51] Connected
Seconds: 5, begin count: 179
Seconds: 10, begin count: 179
Seconds: 15, begin count: 179
Once it was running the strandtest + serial + "!Serial" re-begin code, it stopped in 15 seconds.

I then disconnected everything from the SCORPIO except for the USB-C cable, fully isolating it from the LEDs and the button (wired to pin 5), but the USB serial connection still halts:

Code: Select all

# strandtest with !Serial check and LEDs/button disconnected
[tio 22:29:16] Connected
Seconds: 5, begin count: 176
Seconds: 10, begin count: 176
Seconds: 15, begin count: 176
I tried using a different USB cable and a different USB connection to the motherboard - it still hung, and also partly corrupted/deleted some of the serial transmission:

Code: Select all

# strandtest with !Serial check, LEDs/button disconnected, and different USB cable and USB plug on motherboard
[tio 22:50:47] Connected
Seconds: 5, begin count: 233
Seconds: 10, begin count: 233
Seconds: 15, begin count: 233
20, begin count: 233
Seconds: 25, begin count: 233
With the LEDs entirely disconnected, if I then also modify the code to only call leds.show() once during "setup()", removing it from "loop()" entirely, it lasts more than 10 minutes and still resets properly:

Code: Select all

# strandtest with !Serial check, LEDs/button disconnected
# AND removing all calls to leds.show() in loop(), only calling once during setup()
[tio 22:31:49] Connected
Seconds: 5, begin count: 11
Seconds: 10, begin count: 11
Seconds: 15, begin count: 11
# […trimmed…]
Seconds: 795, begin count: 11
Seconds: 800, begin count: 11
Seconds: 805, begin count: 11
Seconds: 810, begin count: 11

# Pressed "Upload" in Arduino IDE, board resets as expected
[tio 22:45:20] Disconnected
[tio 22:45:27] Connected
Seconds: 5, begin count: 91
So, if I don't call "leds.show()" repeatedly, it works, but.. statically setting the LEDs on "setup()" isn't very fun :)

The issue happens on v1.2.0 and v1.2.3 of the NeoPXL8 library, so the recent DMA change isn't the issue. I tested on my desktop AMD system (with a Gigabyte X570 AORUS MASTER motherboard) and an Intel laptop (System76 Kudu Professional, kud1p) and both show the same issue.

Plus, on the AMD desktop, I have an Adafruit ItsyBitsy M4 Express connected via USB serial to PC control software (Actinic + ActinicArduino firmware), and that functions just fine despite hours of near-continuous USB serial communication.

Let me know if there's any further troubleshooting I can do to help track this down!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by adafruit_support_mike »

digitalcircuit wrote: Wed Jan 25, 2023 12:03 am So, if I don't call "leds.show()" repeatedly, it works
That supports the idea of voltage spikes when the LED colors change.

Try adding a debounce capacitor between the SCORPIO's USB and GND pins, using 100uF as a starting value. That should reduce spikes that make the RP2040 glitch.

User avatar
digitalcircuit
 
Posts: 12
Joined: Wed Jan 09, 2019 11:31 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by digitalcircuit »

adafruit_support_mike wrote: Wed Jan 25, 2023 5:57 pm That supports the idea of voltage spikes when the LED colors change.

Try adding a debounce capacitor between the SCORPIO's USB and GND pins, using 100uF as a starting value. That should reduce spikes that make the RP2040 glitch.
I'll give this a try when I have some time to fire up my soldering station, thank you!

Meanwhile, just to confirm, wouldn't removing the LED connection entirely (on top of not changing the color) avoid any voltage spikes?

I've recorded a quick (47 sec) video to help demonstrate what I mean:
https://www.youtube.com/watch?v=OJ3P2Z6cp8c
Image


From holding Boot on connect, I'm using UF2 Bootloader v3.0, and this happens with both the default Pico SDK USB stack and the Adafruit TinyUSB USB stack.

Amended sketch code (sets a static color once then calls "leds.show()" repeatedly without changes):

Code: Select all

#include <Adafruit_NeoPXL8.h>
time_t last_print = 0;

#define NUM_LEDS    16      // NeoPixels PER STRAND, total number is 8X this!
#define COLOR_ORDER NEO_GRB // NeoPixel color format (see Adafruit_NeoPixel)

// For the Feather RP2040 SCORPIO, use this list:
int8_t pins[8] = { 16, 17, 18, 19, 20, 21, 22, 23 };

Adafruit_NeoPXL8 leds(NUM_LEDS, pins, COLOR_ORDER);

void setup() {
  // Initialize to the fastest common serial baud rate
  Serial.begin(115200);

  // Start NeoPXL8. If begin() returns false, either an invalid pin list
  // was provided, or requested too many pixels for available RAM.
  if (!leds.begin()) {
    // Blink the onboard LED if that happens.
    pinMode(LED_BUILTIN, OUTPUT);
    for (;;) digitalWrite(LED_BUILTIN, (millis() / 500) & 1);
  }

  // Otherwise, NeoPXL8 is now running, we can continue.
  leds.setBrightness(32); // Tone it down, NeoPixels are BRIGHT!
  // Set to black
  for(uint8_t r=0; r<8; r++) { // For each row...
    for(int p=0; p<NUM_LEDS; p++) { // For each pixel of row...
      leds.setPixelColor(r * NUM_LEDS + p, 0, 0, 0);
    }
  }
}

void loop() {
  leds.show();

  uint32_t now = millis();
  if (now - last_print > 1000) {
    Serial.print("[static black color] Seconds: ");
    Serial.println(now / float(1000));
    last_print = now;
  }
}
Result, with no LEDs or anything else connected beyond the required USB-C plug:

Code: Select all

# tio /dev/ttyACM1
# Pressed the SCORPIO's hardware "Reset" button
[tio 18:00:53] Connected
[static black color] Seconds: 1.00
[static black color] Seconds: 2.00
[static black color] Seconds: 3.00
[static black color] Seconds: 4.00
[static black color] Seconds: 5.01
[static black color] Seconds: 6.01
[static black color] Seconds: 7.01

# Hangs, pressed the hardware "Reset" button
[tio 18:02:32] Disconnected
[tio 18:02:33] Connected
[static black color] Seconds: 1.00
[static black color] Seconds: 2.00
[static black color] Seconds: 3.00
[static black color] Seconds: 4.00

# Hangs, pressed the hardware "Reset" button
[tio 18:02:55] Disconnected
[tio 18:02:56] Connected
[static black color] Seconds: 1.00
[static black color] Seconds: 2.00
[static black color] Seconds: 3.00
[static black color] Seconds: 4.00
[static black color] Seconds: 5.01
[static black color] Seconds: 6.01
[static black color] Seconds: 7.01
[static black color] Seconds: 8.01
[static black color] Seconds: 9.01
[static black color] Seconds: 10.01
[static black color] Seconds: 11.01
[static black color] Seconds: 12.01
[static black color] Seconds: 13.01
[static black color] Seconds: 14.01
[static black color] Seconds: 15.02
[static black color] Seconds: 16.02
[static black color] Seconds: 17.02
[static black color] Seconds: 18.02
19.02
[static black color] Seconds: 20.02
[static black color] Seconds: 21.02
[static black color] Seconds: 22.02
[static black color] Seconds: 23.02
[static black color] Seconds: 24.02
[static black color] Seconds: 25.02
[static black color] Seconds: 26.03
[static black color] Seconds: 27.03
[static black color] Seconds: 28.03
[static black color] Seconds: 29.03
[static black color] Seconds: 30.03
[static black color] Seconds: 31.03
[static black color] Seconds: 32.03
[static black color] Seconds: 33.03
[static black color] Seconds: 34.03
[static black color] Seconds: 35.03
[static black color] Seconds: 36.04
[static black color] Seconds: 37.04
[static black color] Seconds: 38.04
[static black color] Seconds: 39.04
[static black color] Seconds: 40.04
[static black color] Seconds: 41.04
[static black color] Seconds: 42.04
[static black color] Seconds: 43.04
[static black color] Seconds: 44.04
[static black color] Seconds: 45.04
[static black color] Seconds: 46.05
[static black color] Seconds: 47.05
[static black color] Seconds: 48.05
[static black color] Seconds: 49.05
[static black color] Seconds: 50.05
[static black color] Seconds: 51.05
[static black color] Seconds: 52.05
[static black color] Seconds: 53.05
[static black color] Seconds: 54.05
[static black color] Seconds: 55.06
[static black color] Seconds: 56.06
[static black color] Seconds: 57.06
[static black color] Seconds: 58.06
[static black color] Seconds: 59.06
[static black color] Seconds: 60.06
[static black color] Seconds: 61.06
[static black color] Seconds: 62.06
# Hangs here as well - the amount of time until it hangs varies
It consistently hangs at inconsistent timing, and occasionally corrupts some of the USB Serial.print() commands too, despite not being connected to any LEDs. The only hardware change was soldering on the provided headers, I confirmed with my multimeter in continuity during assembly that there were no shorts between data and ground, and the RGB LEDs work fine if plugged in (it's just the serial connection that breaks).

If there's lower-level debugging that might help, I can give it a shot. I'll try to look through the RP2040 datasheet sometime soon.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by adafruit_support_mike »

digitalcircuit wrote: Wed Jan 25, 2023 7:42 pm Meanwhile, just to confirm, wouldn't removing the LED connection entirely (on top of not changing the color) avoid any voltage spikes?
It would eliminate the contribution from the LED strip, yes. You still have a whole computer full of digital logic connected to the power supply though. If the glitches are a combination of general noise and extra bursts of noise when the pixels change, you'd still have the general noise component.

The most useful debugging tool would be an oscilloscope, but those are pricey. An analog swinging-needle voltmeter can be useful though.. the needle can show spikes that digital meters can't see.

User avatar
digitalcircuit
 
Posts: 12
Joined: Wed Jan 09, 2019 11:31 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by digitalcircuit »

adafruit_support_mike wrote: Thu Jan 26, 2023 1:31 am It would eliminate the contribution from the LED strip, yes. You still have a whole computer full of digital logic connected to the power supply though. If the glitches are a combination of general noise and extra bursts of noise when the pixels change, you'd still have the general noise component.

The most useful debugging tool would be an oscilloscope, but those are pricey. An analog swinging-needle voltmeter can be useful though.. the needle can show spikes that digital meters can't see.
Your reasoning makes sense; thank you for pointing this out.

Fortunately, I have both a 100µF capacitor from an old project and a USB power meter with rough oscilloscope functionality. It's not high-end, but the results I got might be useful.

I plugged the FNIRSI FNB48 USB meter into a USB plug on my computer, and connected the 100µF capacitor to the SCORPIO's USB and GND pins alongside my digital multimeter (to confirm the capacitor was in circuit via lingering charge after disconnecting).

After multiple tests, I could not reliably determine a difference between having the capacitor in or out of circuit. Sometimes the USB serial connection stopped after 6 seconds, other times it went slightly past a minute, regardless of the capacitor's involvement. The USB power meter's graphs appeared similar, too - Serial.print()'ng clearly results in fractional power noise, but the spikes appear similar when it works (without NeoPXL8) and when it breaks (with NeoPXL8).

In the below graphs, you can see when I hit the Reset button due to the current drop (blue line):

PXL8TestSerialOnly, no NeoPXL8 library, no capacitor
Image
The voltage line is a bit noisy, but it continues functioning just fine long after this screenshot.

PXL8TestSimpleStatic, with NeoPXL8 library, no capacitor
Image
When the serial connection stops working, the voltage line evens out. This could potentially just be showing the power draw of serial transmission given the voltage stayed noisy and continued working when NeoPXL8 wasn't active.

PXL8TestSimpleStatic, with NeoPXL8 library, with capacitor
Image
Adding the capacitor appeared to have no effect.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by adafruit_support_mike »

Post a photo showing your hardware and connections and we'll take a look. 800x600 images usually work best.

User avatar
digitalcircuit
 
Posts: 12
Joined: Wed Jan 09, 2019 11:31 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by digitalcircuit »

Thanks for offering to take a look! Noted on 800×600; I've resized these before uploading.

The last image shows how I tested it (minus the USB-C cable) - I confirmed the capacitor was in circuit and used the digital multimeter to verify the USB power meter findings. I included some other images to show the full assembly and the board solder connections.

#1 - full assembly (cables were removed before tests)
Image

As per the Adafruit SCORPIO guide, only ground is connected between the SATA PC power connector and the SCORPIO board. The SCORPIO board only receives 5vDC power via USB, and the LEDs' connectors only receive 5vDC power via SATA.

The extra connection is between pin 5 and GND, which connects to the computer case's "LED" button.

(It was a lot of fiddly wires, but I did multimeter continuity test first and all connected LEDs behave as expected.)

#2 - close-up of full assembly (again, cables removed before tests)
Image

#3 - board connections, front
Image

#4 - board connections, back
Image

#5 - test setup with capacitor and digital multimeter in circuit
Image

I ensured the digital multimeter pins pushed the 100µF capacitor's leads onto the contacts, making it easier to test with and without the capacitor.

Let me know if there's anything else that would help!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by adafruit_support_mike »

That all looks good.

Try moving the positive leg of the capacitor from the USB pin to the 3V pin. That will acquire the supply rejection of the onboard 3.3V regulator, and should keep power to the microcontroller stable.

User avatar
digitalcircuit
 
Posts: 12
Joined: Wed Jan 09, 2019 11:31 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by digitalcircuit »

adafruit_support_mike wrote: Sun Jan 29, 2023 6:46 pm Try moving the positive leg of the capacitor from the USB pin to the 3V pin. That will acquire the supply rejection of the onboard 3.3V regulator, and should keep power to the microcontroller stable.
Unfortunately, placing the 100µF capacitor between the 3.3v and GND pins didn't seem to have any impact on the stability.

Two additional tests that came to mind; unfortunately, neither were really successful.

Additional testing: using 8× NeoPixel instead of NeoPXL8
I tried demaking the NeoPXL8 strandtest.ino example into a classic NeoPixel version, originally intending to force software bit-banging.

However, after reviewing the NeoPixel library source code, it looks like it automatically uses the RP2040's PIO subsystem anyways, making this test kind of pointless.

Still, with LEDs connected, the following appears to be.. vaguely more reliable. Sometimes the USB serial connection will keep printing for over an hour, other times it'll stop earlier, and the Arduino v2.0.3 IDE frequently has trouble software-resetting the board into bootloader mode.

I'd have sent this reply earlier, but I kept trying variations of this and couldn't get consistent results.

NeoPixel demake sample code

Code: Select all

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
  #include <avr/power.h>
#endif

#include <Adafruit_NeoPXL8.h>
time_t last_print = 0;
uint8_t reset_count = 0;

#define NUM_LEDS    16      // NeoPixels PER STRAND, total number is 8X this!
#define COLOR_ORDER NEO_GRB // NeoPixel color format (see Adafruit_NeoPixel)

// For the Feather RP2040 SCORPIO, use this list:
int8_t pins[8] = { 16, 17, 18, 19, 20, 21, 22, 23 };

// Here's the global constructor as explained near the start:
//Adafruit_NeoPXL8 leds(NUM_LEDS, pins, COLOR_ORDER);
Adafruit_NeoPixel pixels[8] = {
  Adafruit_NeoPixel(NUM_LEDS, pins[0], NEO_GRB + NEO_KHZ800),
  Adafruit_NeoPixel(NUM_LEDS, pins[1], NEO_GRB + NEO_KHZ800),
  Adafruit_NeoPixel(NUM_LEDS, pins[2], NEO_GRB + NEO_KHZ800),
  Adafruit_NeoPixel(NUM_LEDS, pins[3], NEO_GRB + NEO_KHZ800),
  Adafruit_NeoPixel(NUM_LEDS, pins[4], NEO_GRB + NEO_KHZ800),
  Adafruit_NeoPixel(NUM_LEDS, pins[5], NEO_GRB + NEO_KHZ800),
  Adafruit_NeoPixel(NUM_LEDS, pins[6], NEO_GRB + NEO_KHZ800),
  Adafruit_NeoPixel(NUM_LEDS, pins[7], NEO_GRB + NEO_KHZ800)
};

// For this demo we use a table of 8 hues, one for each strand of pixels:
static uint8_t colors[8][3] = {
  255,   0,   0, // Row 0: Red
  255, 160,   0, // Row 1: Orange
  255, 255,   0, // Row 2: Yellow
    0, 255,   0, // Row 3: Green
    0, 255, 255, // Row 4: Cyan
    0,   0, 255, // Row 5: Blue
  192,   0, 255, // Row 6: Purple
  255,   0, 255  // Row 7: Magenta
};

// setup() runs once on program startup:
void setup() {
  // Initialize to the fastest common serial baud rate
  Serial.begin(115200);

  /*
  // Start NeoPXL8. If begin() returns false, either an invalid pin list
  // was provided, or requested too many pixels for available RAM.
  if (!leds.begin()) {
    // Blink the onboard LED if that happens.
    pinMode(LED_BUILTIN, OUTPUT);
    for (;;) digitalWrite(LED_BUILTIN, (millis() / 500) & 1);
  }
  */

  for(uint8_t r=0; r<8; r++) { // For each row...
    pixels[r].begin();
  }

  // Otherwise, NeoPXL8 is now running, we can continue.
  //leds.setBrightness(32); // Tone it down, NeoPixels are BRIGHT!
  for(uint8_t r=0; r<8; r++) { // For each row...
    pixels[r].setBrightness(32);
  }
}

// loop() runs over and over indefinitely. We use this to render each frame
// of a repeating animation cycle based on elapsed time:
void loop() {
  if (!Serial) {
    Serial.begin(115200);
    reset_count++;
  }
  
  if (Serial.available()) { 
    // Echo serial data
    Serial.print("Echo: ");
    Serial.write(Serial.read());
    Serial.println();
  }

  uint32_t now = millis(); // Get time once at start of each frame
  for(uint8_t r=0; r<8; r++) { // For each row...
    for(int p=0; p<NUM_LEDS; p++) { // For each pixel of row...
      //leds.setPixelColor(r * NUM_LEDS + p, rain(now, r, p));
      pixels[r].setPixelColor(p, rain(now, r, p));
    }
  }
  //leds.show();
  for(uint8_t r=0; r<8; r++) { // For each row...
    pixels[r].show();
  }

  if (now - last_print > 5000) {
    Serial.print("[NeoPixel non-DMA] Seconds: ");
    Serial.print(now / 1000);
    Serial.print(", begin count: ");
    Serial.println(reset_count);
    last_print = now;
  }
}

// Given current time in milliseconds, row number (0-7) and pixel number
// along row (0 - (NUM_LEDS-1)), first calculate brightness (b) of pixel,
// then multiply row color by this and run it through NeoPixel library’s
// gamma-correction table.
uint32_t rain(uint32_t now, uint8_t row, int pixelNum) {
  uint8_t frame = now / 4; // uint8_t rolls over for a 0-255 range
  uint16_t b = 256 - ((frame - row * 32 + pixelNum * 256 / NUM_LEDS) & 0xFF);
  return pixels[0].Color(pixels[0].gamma8((colors[row][0] * b) >> 8),
                         pixels[0].gamma8((colors[row][1] * b) >> 8),
                         pixels[0].gamma8((colors[row][2] * b) >> 8));
}
I guess the sequential data transmission triggers less of the issue as compared to sending 8 channels in parallel..?

If there's a way to force the NeoPixel library to use software bit-banging instead of the RP2040's PIO interface, I could try that?

Additional testing: Laptop on battery power with less voltage swing does not resolve the issue

I've also found out that the slight (0.02v) voltage swings on the desktop are potentially from elsewhere in the computer. However, repeating this test with the LEDs plugged in to the desktop and the SCORPIO USB connected to my laptop on battery power has the same issue despite a cleaner output (0.01v voltage swing).

USB power meter graph for laptop on battery power, NeoPixel library, LEDs connected
Image


Let me know if there are any further troubleshooting steps! I'm kind of stumped by this.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by adafruit_support_mike »

Do your best to capture scope traces at the time when the board stops responding. The more information you have about the failure, the better you'll be able to fix it.

User avatar
digitalcircuit
 
Posts: 12
Joined: Wed Jan 09, 2019 11:31 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by digitalcircuit »

adafruit_support_mike wrote: Fri Feb 03, 2023 10:46 pm Do your best to capture scope traces at the time when the board stops responding. The more information you have about the failure, the better you'll be able to fix it.
I'll look into doing this soon (synchronizing the USB power meter graph to serial output, e.g. via screen recording). I might also have access to other computers to test from.

I appreciate your persistence!

Meanwhile, to try to help narrow this down, I explored another path…

CircuitPython works without issue - possible Arduino firmware/library issue, not electrical..?

I tried flashing CircuitPython v8.0.0-rc2 on the SCORPIO, and the provided project code bundle at the end (with strand_length = 16).

The project code bundle appears to keep the USB serial connection alive despite running for over 20 hours, continuing to print the FPS over serial and make all the connected LED strands spin colorfully.

After 20+ hours, I could send a Ctrl+C to interrupt the code without issue, then send Ctrl+D to resume.

Code: Select all

[tio 23:56:09] Connected
176.6fps
280.2fps
279.7fps
279.6fps
278.2fps
[…pressed Ctrl+C to interrupt sample code…]
Traceback (most recent call last):
  File "code.py", line 58, in <module>
  File "adafruit_led_animation/group.py", line 157, in animate
  File "adafruit_led_animation/animation/__init__.py", line 90, in animate
  File "adafruit_led_animation/animation/__init__.py", line 119, in show
  File "adafruit_led_animation/helper.py", line 188, in show
  File "adafruit_neopxl8.py", line 210, in _transmit
KeyboardInterrupt: 

Code done running.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.

Press any key to enter the REPL. Use CTRL-D to reload.

[…pressed Enter…]
Adafruit CircuitPython 8.0.0-rc.2 on 2023-02-02; Adafruit Feather RP2040 Scorpio with rp2040
>>> 
[…pressed Ctrl+D to exit prompt…]

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
280.2fps
278.2fps
278.7fps
275.7fps
279.7fps
280.6fps
276.8fps
[…trimmed serial output, waiting over 20 hours…]
[It settled on about 10 FPS less, but no noticeable issues]
267.5fps
262.5fps
264.9fps
263.7fps
263.2fps
261.2fps
263.9fps
[…pressed Ctrl+C to interrupt sample code…]
Traceback (most recent call last):
  File "code.py", line 58, in <module>
  File "adafruit_led_animation/group.py", line 157, in animate
  File "adafruit_led_animation/animation/__init__.py", line 85, in animate
  File "adafruit_led_animation/animation/comet.py", line 134, in draw
  File "adafruit_led_animation/helper.py", line 142, in __setitem__
  File "adafruit_led_animation/helper.py", line 129, in _set_pixels
KeyboardInterrupt: 

Code done running.

Press any key to enter the REPL. Use CTRL-D to reload.

[…pressed Enter…]
Adafruit CircuitPython 8.0.0-rc.2 on 2023-02-02; Adafruit Feather RP2040 Scorpio with rp2040
>>> 
[…pressed Ctrl+D to exit prompt…]

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
263.7fps
263.6fps
263.5fps
Considering the timing requirements of NeoPixel LEDs mandate similar electrical signals being sent (unlike DotStars which use an external clock pulse), since the lightly-modified Arduino/C++ Adafruit sample code (shared in this thread) breaks USB serial, but the CircuitPython sample code keeps USB serial working...

Is it possible that there is a low-level issue with the Arduino IDE setup or libraries..?

If Adafruit has a specific Arduino IDE setup for testing the Feather RP2040 SCORPIO board, I could try recreating that. I noted my system details on the NeoPXL8 issue.

User avatar
digitalcircuit
 
Posts: 12
Joined: Wed Jan 09, 2019 11:31 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by digitalcircuit »

Update: this is a known issue for the NeoPXL8 Arduino library

I've heard back on the issue I filed on the NeoPXL8 library, and apparently this is a known problem that hasn't yet been solved.

Until a solution is found for the Arduino/C++ library issue, CircuitPython's NeoPXL8 library can be used as a workaround.

Thank you very much for your time and effort helping me troubleshoot this! I'll follow up here when there's more to share, or a solution is found.

User avatar
digitalcircuit
 
Posts: 12
Joined: Wed Jan 09, 2019 11:31 pm

Re: NeoPXL8 (& HDR) strandtest hangs USB serial on RP2040 SCORPIO?

Post by digitalcircuit »

✅ Success: this issue has been resolved in NeoPXL8 version 1.2.4

Thanks to investigation by PaintYourDragon, this issue has been tentatively resolved in NeoPXL8 version 1.2.4, now in the Arduino Library Manager.

I'll keep an eye on the situation, and if I run into this issue again, I'll follow up on the GitHub issue.

Once again, thank you for your time and effort helping me troubleshoot!

Locked
Please be positive and constructive with your questions and comments.

Return to “Feather - Adafruit's lightweight platform”