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
Using SPIFFS and SDSPI together at the same time results in a lockup (IDFGH-4722) #6529
Comments
@pyjamasam For the cache issue, could you please try modifying static void SPI_MASTER_ISR_ATTR spi_bus_intr_disable(void *host) (add SPI_MASTER_ISR_ATTR). For the lockup issue, it seems you have interrupt watchdog disabled in sdkconfig. Could you please try enabling it and see if this yields any additional information (e.g. a backtrace)? |
Thanks for the quick response Ivan, Enabling the interrupt watchdog did not result in any change to the lockup observed when using my sdkconfig.project file. It still resulted in a silent lockup and then the following message after restarting
And the default sdkconfig that is also in the repository had that flag enabled and produced the original stack trace included in the issue. BUT Adding I will test the fix in my larger application and report back the status of that. |
I have been running at test for about 20 hours now, and I can successfully write the the SD card and continue to read from SPIFFS. This is using the IDF v4.2 tag with the modification to spi_master.c. Thank you very much for the help with with. From my standpoint I consider this to be fixed, but I'd like to see it as part of the official repo. |
Thanks for the confirmation @pyjamasam, we will fix this in the master branch and also backport to release/v4.2. This issue will be closed once the fix is merged. |
Hi @igrr |
Hi @AxelLin , It's being reviewed internally. There's no other considerations about it, so I think the reviewing will be fast. |
Thanks for reporting, fix on master branch is available de0f24e, we are back porting the fix to release/4.2, thanks. |
Environment
Problem Description
When writing to a SDSPI connected SD card (Using the VSPI bus with the standard pins via IOMUX) in one task and trying to read a file from a SPIFFS partition in another task from the same core an exception occurs.
The current example code is using fatfs directly vs through the VFS layer as I was attempting to trim down the code that caused the problem. But this problem also occurs when using the vfs layer for SD card access.
Expected Behavior
Data should be written to the SD card, and data should be read from the SPIFFS partition
Actual Behavior
When running with my project sdkconfig file settings the chip locks up and eventually resets due to the watchdog with a DoubleException
When running the a default sdkconfig file a core panic occurs due to 'Cache disabled but cached memory region accessed'
Steps to reproduce
A repository with code to reproduce the error
https://github.com/pyjamasam/SPIFFS_SDSPI_Test
Connect a SD card via the VSPI standard pins:
MOSI = GPIO23
MISO = GPIO19
CLK = GPIO18
CS = GPIO5
I have tried with a 10k pull up to 3.3v on MOSI.
Running the referenced code will result in an error (when the SD card initializes correctly - once the error occurs the esp will restart and then the SD card will not initialize correctly. It then takes a few restart cycles until the SD card is ready to be used again).
Code to reproduce this issue
https://github.com/pyjamasam/SPIFFS_SDSPI_Test
Debug Logs
Other items if possible
The text was updated successfully, but these errors were encountered: