-
Notifications
You must be signed in to change notification settings - Fork 174
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
Modify ESP32 SPI flash driver to be compatible with stacks in PSRAM (CON-1518) #1249
Comments
Example failure when I move task stack into PSRAM. I wish there were an option to just make SPI flash use PSRAM safe without me having to search all over over people's code and needing to change things. In this case it is my Lua interpreter and Lua needs a 50K stack. I would love to get that stack into PSRAM.
|
So I fix the previous one, and then there's just another one... and I have no clue how many places I will need to fix this. The best way to fix this is to modify the SPI flash driver to have a hidden internal task which switches stacks. Then I enable use of that hidden task via menuconfig.
|
You can't do flash writes from tasks which have their stack in PSRAM. That's just a limitation of the ESP architecture. The work around for this is to make a worker task with a small stack in internal RAM and then queue the writes to this worker task.
The trouble with this is that now I have to hunt down every place which is doing flash writes and then change the code to queue them to the worker task. How about giving me an option in the ESP IDF SPI flash driver to do flash writes from a worker task? Then the IDF will automatically modify everything which does flash writes.
This is not as simple as it seems, for example the flash write currently bothering me is inside the SPIFFS file system code. Since I don't want to modify SPIFFS now I have to move my file system calls into a worker task.
The text was updated successfully, but these errors were encountered: