-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
Resolves Timed out waiting for RSA operation #256
Resolves Timed out waiting for RSA operation #256
Conversation
…nnectivity with mbedtls
Hi nathanjel, Thanks for debugging this, sorry I didn't reply earlier to the issue.. I admit when I wrote the "fundamental problem with the driver" comment I was thinking that if the bignum operation didn't complete within 2 seconds, this would be a driver bug. However it sounds like here what is happening is that the bignum ISR is being starved out for more than 2 seconds (so the interrupt completed, but it hasn't had a chance to run on CPU and flag the semaphore.) The change you sent is very illuminating. LOWMED is the default interrupt priority, if you don't provide any level flags. So it seems like setting IRAMONLY is what makes the difference here. This is the correct flag, given the handler is entirely implemented in IRAM. However, it's still a little odd - I don't really understand why the ISR could remain unserviced for two seconds when the handler is in flash, and not when it's in IRAM, even though the priority is nominally the same. You said your program makes intensive use of a lot of features, do any of those features involve erasing or writing to flash (or use the NVS API or anything else that might be writing to flash in the background)? Angus |
Hi, Indeed, my code does use spi_flash_* functions every few minutes, to save accumulated data and eventually update configuration (it's a hi-tech dimmer, needs to keep state and record energy consumption) Actually, to make my stability tests more robust, for testing I changed the code so that it writes a flash page every two seconds. In normal usage scenarios it might be every few minutes up to every few days, depending on frequency of user interactions. I am using my own filesystem over spi_flash_* for it (https://github.com/nathanjel/ffs) and I also had to tweak a bit the whole solution reg. task core affinity (see #258), otherwise the flash functions would abort() every few usages. To be 100% honest - my fix suggestion was intuitive - obviously I have less exposure to ESP32 internals than the team behind the esp-idf, but i thought it was good to share what worked in my case. Marcin |
Do you happen to run any tasks at the highest priority level in your system (23)? |
No, I do not. I use the lower priority numbers. Below is how I start all my tasks.
|
Okay, I see. Actually this issue dovetails nicely with the other one about spi_flash, and I think I see what the cause of both issues is. Will do some tests today and update you later. |
This happens after I enable optimization.
and GDB
|
The spi_flash issue solution closed this particular PR and related issues. |
is the pull request accepted? in dev 3.2 idf I still see |
Resolves Timed out waiting for RSA operation abort while using SSL connectivity with mbedtls