cancel
Showing results for 
Search instead for 
Did you mean: 

FatFs returns FR_TIMEOUT

MauFanGilaMedical
Associate III

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.

 

MauFanGilaMedical_0-1766416113673.png

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.

2 REPLIES 2
TDK
Super User

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.

If you feel a post has answered your question, please click "Accept as Solution".

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 ?