in my labor, I can't reproduce the error. It occurs only in the "Field". I have built a logging device which is logging the data of a GPS and the incremental sensors of a robot.
After 2 / 3 minutes of logging, it stops. Every time there is a logging amount of around 175kB of data. Do you have any idea of searching or debugging this error? Debugging is easy in a good environment like the labor, but how can I debug it in "field" / on the road?
I am using an STM32F407 controller with FatFS and SDIO for connecting the 8 GB micro SD-Card. The Gps (linx-receiver) and the incremental sensor are connected via UART.
In the Old days I had some problems with a FatFS version... It seems that it needed to be compiled with optimization level -O2.
Also, check for buffer overflows and critical regions in your code.
Another thing can be from the power source, SD cards tend to consume a lot of power when the sectors are closed, use in the field a big battery with lots o capacitors for noise removal.