Long write period using freeRTOS FAT FS

stodd67 wrote on Monday, November 18, 2019:

Hello all,

I’ll keep this as short as I can. I will leave out a lot of detail for now.

Hardware : STM32L071
Software : freeRTOS kernal with FAT FS.
SD card driver : bespoke SPI driver

I am developing an application to write/read to/from an SD card. I can successfully read/write to an SD card. When a do a logic grab there is a long period of 18 seconds of continously writing to the SD card. This occurs about every 5-6 hours. I have looked through the FAT FS code, but can’t find any obvious reason why this would happen. My application needs to use a watchdog timer and this long period of a task activity will cause it to reset the system.

Is this type of period normal? Is there any thing I can do to reduce it?

As stated above, it all works, but this long period is an issue for me.

Thanks,
Stephen.

richard_damon wrote on Monday, November 18, 2019:

I don’t know what could be causing that, but one thing you could do is wait for it to happen, and while it is doing it use a debugger to stop the system and see what is running.

The one thing I can think of is something deciding to flush some cache, or maybe checkpointing a large datastructure to the device.