-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Enable protomatter on RP2040 builds #4186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also found a race condition between timer_disable and redraw, which would happen if I debugger-paused inside common_hal_rgbmatrix_timer_disable or put a delay or print inside it. That's what pausing inside reconstruct fixes. So that the "right timer" can be chosen, `timer_allocate` now gets the `self` pointer. It's guaranteed at this point that the pin information is accurate, so you can e.g., find a PWM unit related to the pins themselves. This required touching each port to add the parameter even though it's unused everywhere but raspberrypi.
763f7ac
to
ff1942c
Compare
These changes are tested along with adafruit/circuitpython#4186 and work on a 32x32 matrix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any issues. Thanks! (Not approving because it's a draft.)n
Thanks! We should probably wait for the pull request up at protomatter to be accepted first, but I marked this ready for review anyhow. |
These changes are tested along with adafruit/circuitpython#4186 and work on a 32x32 matrix.
I was confused about the "red X" failed CI notes, but those are for the Protomatter CI running in my fork, on a commit that refers to this PR. Click over to the "checks" tab to see a green board. |
ok so... technically yes this does work. |
Uh oh, it worked better than that for me. I'll test further on Monday. I know I tested being in the REPL, soft restarting, but mmmmaybe not writing to CIRCUITPY. |
I tested by loading an adapted version of the fruit demo from https://github.com/adafruit/Adafruit_Learning_System_Guides/blob/master/CircuitPython_RGBMatrix/fruit.py and causing heavy CIRCUITPY filesystem activity by running I also re-tested entering and using the REPL and didn't encounter problems. While writing to CIRCUITPY, the display will temporarily glitch. I believe this is because code can only execute from SRAM during flash erase (and write?) operations. Since protomatter (like most of the rest of circuitpython) resides in the flash it can't be executed during this time. Anyhow, as a merge conflict had arisen I've merged main into this PR and with any luck there will be fresh artifacts shortly. |
We figured out why @ladyada and I were having ahem varying levels of success. Limor was testing the prototype Feather, while I was testing the pico. Feather has a status LED. At the time everything goes south, GDB says...
I can now investigate this properly. |
I got another hung backtrace, again using the feather uf2 but not obviously related to neopixel:
|
@ladyada I re-tested the slot machine demo from Adafruit_Learning_System_Guides/CircuitPython_RGBMatrix using the Feather RP2040 build and my Pico pinout on a Pico, but with R and B pin swapped to trigger the bug I was able to reproduce. During the testing process, I ten times hit ctrl-c, ctrl-d to re-load the program, and caused filesystem activity with I did not observe any hard-faults or lockups, only the expected screen flickering while writing to CIRCUITPY. I did the same test with your Feather pinout, and while I couldn't see the display I also didn't have any lockups or hard-faults. |
See adafruit/Adafruit_Protomatter#36 for the PWM slice number fix, already merged in yay |
i did test, i had a wierd hardfault once but couldnt repro it, and i think it had more to do with USB so this is ok to merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested with feather + matrix featherwing!
Testing performed: ran on a 32x32 display
Other testing performed:
Also found a race condition between timer_disable and redraw, which would happen if I debugger-paused inside common_hal_rgbmatrix_timer_disable or put a delay or print inside it. That's what pausing inside reconstruct
fixes.
So that the "right timer" can be chosen,
timer_allocate
now gets theself
pointer. It's guaranteed at this point that the pin information is accurate,so you can e.g., find a PWM unit related to the pins themselves. This required touching each port to add the parameter even though it's unused everywhere but raspberrypi.Here's my testing code, with a 32x32 matrix: