Closed rsiemens77 closed 9 months ago
Bit of a long shot, but does Check menuconfig > Component config > Driver config > UART > UART ISR in IRAM
fix it?
A good shot! That fixed it! Thanks!
Excellent! Do you know if esp_littlefs
is doing anything incorrectly when it comes to uart interrupts? I see two non-mutually-exclusive options:
I mention this issue/solution in the README.
Is there a proper code fix? Or is this just the way it is?
I don't really understand why the problem was exhibited in this way. My conclusion is this was a misconfiguration problem with my UART usage, that for unknown reason manifested with this LFS symptom. I suspect it's not really relevant to LFS and is probably already covered in the UART documentation. I adapted some example code I found, so probably need to go back and read the UART docs.
I don't think there's anything for you to do. But, the lowest level of the stack trace mentions
0x4011bff5: uart_set_line_inverse at C:/exp/frameworks/esp-idf-v4.4.6/components/driver/uart.c:324
I did briefly try to find that in the source code. I didn't see how LFS had any UART dependancy, and am wondering if that's incorrect? You would know better. How did you know the possible solution? Just your experience with ESP32 and configuration or is there actually some kind of UART usage?
For what it's worth, I also posted the issue in ESP32 support forum and got the same suggestion you made from one of the staff.
Update, I asked for more info to ESP tech. He pointed to this:
So that makes more sense...
these APIs disable the caches suspends all the other tasks. Besides, all non-IRAM-safe interrupts will be disabled. The other core will be polling in a busy loop. These will be restored until the Flash operation completes.
I would put a pointer to this in the README and mention the possible contention with other devices such as UART.
makes sense! I'll update the README.
How did you know the possible solution?
My thought was:
LittleFS has nothing to do with UART, but you aren't the first person to mention weird issues with UART.
Your stack trace had interrupt-like functions in it.
At some point in my esp32 development life, I read that the esp32 has something weird about flash access and interrupts and stuff.
Closing this issue.
I am running my application on ESP32E, 4MB, with IDFv4.4.6.
My applicatioin is structured with below two tasks running on Core 0. SerialReceiverTask, priority 2, uses interrupts to read from UART2, and passes data to queue. WebServerTask, priority 1, serves HTTP requests, some of which use LittleFS
There is a constant stream of data coming in on UART2. But there's still plenty of time to respond to HTTP requests. Requests that don't use LittleFS respond fine, regardless if there is incoming data on the UART or not.
The request that accesses LittleFS also work fine when I disconnect the serial line so there's no incoming data on the UART. However, if there is incoming data, and I make the request, it consistently crashes as below. The first 3 lines only show up on the console, not in the decoded hex backtrace. I'd appreciate any insights on the problem.