[NeoPixel] Fix issue running addressable LEDs on ESP32S3 with OPI PSRAM #5254
+37
−10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.