guild icon
Toit
#Issues with simple Neopixel code
Thread channel in help
alex (he/him)
alex (he/him) 10/26/2025 07:52 PM
Using the following code, I get this when using jag monitor. Any ideas?

import gpio import pixel_strip show PixelStrip PIXELS ::= 1 main: pin := gpio.Pin 08 pixels := PixelStrip.uart PIXELS --pin=pin r := ByteArray PIXELS g := ByteArray PIXELS b := ByteArray PIXELS r.fill 0x44 g.fill 0x80 b.fill 0xff pixels.output r g b sleep --ms=1
floitsch
floitsch 10/26/2025 07:55 PM
Interesting.
10:1 is uart::create if I'm not wrong
floitsch
floitsch 10/26/2025 07:55 PM
I don't see how and/or why that would take too long
floitsch
floitsch 10/26/2025 07:55 PM
Is it reproducible?
floitsch
floitsch 10/26/2025 07:57 PM
In the meantime, you can just use Pixelstrip.rmt. (for one pixel that should work perfectly fine)
floitsch
floitsch 10/26/2025 08:08 PM
I can reproduce.
floitsch
floitsch 10/26/2025 08:08 PM
And the rmt variant doesn't seem to work either.
Very strange.
I will debug.
alex (he/him)
alex (he/him) 10/26/2025 08:08 PM
rmt puts it into deep-sleep
alex (he/him)
alex (he/him) 10/26/2025 08:09 PM
alexanderniebuhr@MacBookPro ~/D/P/c/toit [1]> jag monitor ✔ /dev/cu.usbmodem578E0248291 Starting serial monitor of port '/dev/cu.usbmodem578E0248291' ... J�ESP-ROM:esp32c6-20220919 Build:Sep 19 2022 rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT) SPIWP:0xee mode:DIO, clock div:2 load:0x40875720,len:0x9c load:0x4086c110,len:0xb94 load:0x4086e610,len:0x2534 entry 0x4086c110 [toit] INFO: starting <v2.0.0-alpha.188> [toit] DEBUG: clearing RTC memory: invalid checksum [toit] INFO: running on ESP32C6 - revision 0.0 [toit] INFO: entering deep sleep without wakeup time
floitsch
floitsch 10/26/2025 08:10 PM
How did you install the rmt version?
floitsch
floitsch 10/26/2025 08:10 PM
For me it just doesn't do anything.
floitsch
floitsch 10/26/2025 08:11 PM
could it be that the program finishes, and then nothing is left to do, and the system goes into deep-sleep?
alex (he/him)
alex (he/him) 10/26/2025 08:11 PM
Just installed it and then jag monitor
floitsch
floitsch 10/26/2025 08:11 PM
installed it how?
alex (he/him)
alex (he/him) 10/26/2025 08:11 PM
Neopixel doesn't light up
alex (he/him)
alex (he/him) 10/26/2025 08:11 PM
/Users/alexanderniebuhr/.cache/jaguar/sdk/bin/toit compile --snapshot -o hello.snapshot hello.toit && /Users/alexanderniebuhr/.cache/jaguar/sdk/bin/toit tool firmware -e firmware.envelope container install -o hello.envelope hello hello.snapshot && /Users/alexanderniebuhr/.cache/jaguar/sdk/bin/toit tool firmware -e hello.envelope flash --port /dev/tty.usbmodem1401 --baud 921600
floitsch
floitsch 10/26/2025 08:11 PM
Ok. That confirms my suspicion.
floitsch
floitsch 10/26/2025 08:12 PM
Basically, your program finishes, and the system then decides that nothing is left to do and shuts down.
floitsch
floitsch 10/26/2025 08:12 PM
If you increase the sleep, you will see that it doesn't go into deep sleep immediately.
floitsch
floitsch 10/26/2025 08:12 PM
However, there is a bug with the rmt PixelStrip.rmt on the C6(edited)
alex (he/him)
alex (he/him) 10/26/2025 08:12 PM
Oh let me put a loop with logs, but I think that doesn't light up the pixel anyways
floitsch
floitsch 10/26/2025 08:13 PM
You can work around it for now with the (deprecated) I2sPixelStrip:
import pixel_strip show I2sPixelStrip ... main: ... pixels := I2sPixelStrip PIXELS --pin=pin
floitsch
floitsch 10/26/2025 08:14 PM
I will debug the other ones.
alex (he/him)
alex (he/him) 10/26/2025 08:16 PM
I still don't get it to light up. But I'm using a strange waveshare dev board :🤔:
floitsch
floitsch 10/26/2025 08:17 PM
ESP32-C6 Microcontroller, WiFi 6 Development Board, 160MHz Single-core Processor, ESP32-C6-WROOM-1-NX Series Module, Supports USB And UART Development | ESP32-C6-DEV-KIT-N8
alex (he/him)
alex (he/him) 10/26/2025 08:18 PM
yeah
floitsch
floitsch 10/26/2025 08:18 PM
pin 8 looks correct, and I manage to make mine light up. So that's a bit weird.
floitsch
floitsch 10/26/2025 08:19 PM
So the I2sPixelStrip variant doesn't work for you?
alex (he/him)
alex (he/him) 10/26/2025 08:20 PM
No. But can be my board..
floitsch
floitsch 10/26/2025 08:21 PM
Either way, the uart-deadlock is clearly a bug. And the RMT should also work.
I just tested on the normal ESP32 and there all three work.
Will now try with the s2, s3 and C3.
👍1
floitsch
floitsch 10/26/2025 08:25 PM
S2 works.
floitsch
floitsch 10/26/2025 08:30 PM
C3 only works with uart and I2s.
floitsch
floitsch 10/26/2025 08:31 PM
I'm guessing RMT is currently broken on C3 and C6, and uart is broken on C6.
alex (he/him)
alex (he/him) 10/26/2025 08:42 PM
I'll get new prototype boards next week.. c3 & c6. But sounds like I have to switch to s3
floitsch
floitsch 10/26/2025 08:44 PM
The c6 shouldn't be broken.
I'm already debugging the UART issue.
floitsch
floitsch 10/26/2025 09:55 PM
I made a bit of progress, but no solution yet.
We are stuck in uart_ll_update, which waits for the peripheral to clear a bit.
I think the clock isn't active which is why we just keep looping there.
Will give up for today, but this is now a high priority.
36 messages in total