-
Notifications
You must be signed in to change notification settings - Fork 9
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
Execution hangs on sleep_us(1)
on Pico W
#5
Comments
I will cross-test this with my screen aswell during the weekend, would be interesting if this works for me too. |
Soo.. it wasnt exactly uh.. "that weekend", sorry for that. BUT! i can confirm, that with a |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@Stale As far as I know, this is still an issue. |
I can confirm, this is still broken. Waiting for a response from what the Repository Owner wants to do |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Issues usually don't get fixed by ignoring them. |
Indeed, this fix is essentially free (it takes less than 3 minutes to implement). Although this library is painfully slow anyway. Iirc, the screen/driver supports to dump the whole framebuffer into it at once, which would be lots faster (but consume more RAM ofc) |
On my Raspberry Pi Pico W using the latest SDK, trying to use the library leads to crashing the CPU – execution just hangs, and the chip doesn't do anything else. Here's my project that reproduces the bug: pico-st7789-bug. (This is happening regardless of whether there's any display connected to the Pico.)
I found out that it's caused by the
sleep_us(1)
calls at various places in the code (lines: 28, 33, 38, 40, 45, 50, 159, 164, 170, 175). It seems that there is a race condition in the SDK that leads to missing the interrupt for the short timer and hanging indefinitely – potentially only on Pico W devices. Related issues: raspberrypi/pico-sdk#1552, raspberrypi/pico-sdk#1500, micropython/micropython#12873If I remove all these
sleep_us
calls, the library starts working as expected, and I'm able to run the blink example on a 240x240 display. If there isn't sufficient rationale for thesleep_us(1)
calls, I advise to remove them altogether – at least for me the library works perfectly without them. However, if they are necessary for correct timing, we can replace them with something likebusy_wait_at_least_cycles
, and if they're a walkaround forspi_write_blocking
not blocking enough, they can be replaced with a busywait until SPI is done:I can make a PR with any of the proposed solutions.
The text was updated successfully, but these errors were encountered: