2025-12-22 7:16 AM - edited 2025-12-22 7:20 AM
Hello.
I have developed a firmware using FREEROTS and FatFS.
I have setted FREERTOS with :
- one thread (osPriorityNormal, 24) that perform massive read on uSD file (100MByte) to search a string (the search takes at least 40secs)
- a software timer (priority 2) that, in a certain moment, write a string in certain position in another file.
What I observe is that that FatFS f_lseek API called in software timer returns FS_TIMEOUT when the thread is performing massive read.
I'm tempted to augment FS_TIMEOUT to 100 secs or augment software timer priority to a number greather than 24 (osPriorityNormal) but have you another suggestion ? Is it the right way ?
Thankyou in advance.
2025-12-22 7:35 AM
Maybe chunk up the read into smaller portions so you can yield to other threads needing access to the file.
Increasing timeout is fine if you're okay with the other threads stalling.
I don't think adjusting priorities will help here. Once the read starts, you're locked in.
2025-12-22 7:44 AM - edited 2025-12-22 7:46 AM
Ok, but If I chunk up the read into smaller portion and I call threadYield between this portions I think that I will obtain FS_TIMEOUT because of Timer low priority respect to the other thread, right ?