Skip to content
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

[NeoPixel] Fix issue running addressable LEDs on ESP32S3 with OPI PSRAM #5254

Open
wants to merge 2 commits into
base: mega
Choose a base branch
from

Conversation

TD-er
Copy link
Member

@TD-er TD-er commented Feb 13, 2025

Fixes: #5253

For builds with "OPI PSRAM", the entire sketch is uploaded from flash to PSRAM at boot as PSRAM is way faster than flash. (about 3x faster) This is also why the reported PSRAM size is about 5 MB while you have 8 MB PSRAM.

Another side-effect is that there is another threshold for allocating memory to internal or PSRAM based on size. So starting from 64 LEDs, the malloc switches to use PSRAM instead of internal RAM.

Problem is that we can't use DMA from PSRAM while we have read- and write-access to it. So the change in this test build is to force allocating memory on internal RAM and use a flag to make sure it is DMA accessible.

Timeout is set to 100 msec, which is enough for not really blocking the ESP, but should still not happen anyway as it allows for roughly 2000 LEDs to be updated in that period.

Fixes: letscontrolit#5253

For builds with "OPI PSRAM", the entire sketch is uploaded from flash to PSRAM at boot as PSRAM is way faster than flash. (about 3x faster)
This is also why the reported PSRAM size is about 5 MB while you have 8 MB PSRAM.

Another side-effect is that there is another threshold for allocating memory to internal or PSRAM based on size.
So starting from 64 LEDs, the malloc switches to use PSRAM instead of internal RAM.

Problem is that we can't use DMA from PSRAM while we have read- and write-access to it.
So the change in this test build is to force allocating memory on internal RAM and use a flag to make sure it is DMA accessible.

Timeout is set  to 100 msec, which is  enough for not really blocking the ESP, but should still not happen anyway as it allows for roughly 2000 LEDs to be updated in that period.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Issue with NeoPixel in Christmass max release
1 participant