cancel
Showing results for 
Search instead for 
Did you mean: 

f_write is returning fr_invalid_object error....

kishore R
Associate II
Posted on December 26, 2016 at 12:12

I have downloaded two example project for SD card read & write, One is  FatFS_uSD(standalone project) and second one is FatFS_uSD_RTOS(with FreeRTOS) from the ST link.

I am doing continuous write(f_write) to the sd card without any delay between two write(f_write) operation and i am running sd clock as 4mz. In each write(f_write) i am writing 10KB of data.

Now in FatFS_uSD(standalone) project,  I am able to write without any error till 3GB of data.This is fine. But same configuration and test is failing in 

FatFS_uSD_RTOS(with FreeRTOS) project. after writing so much of data f_write API is returning 'fr_invalid_object' error. this project is not even completed 200mb of data without fail.

Is this problem with running FatFS in freeRTOS?

Please suggest something to debug and solve this issue....

#f_write-is-returning-fr_invalid_object-error....
2 REPLIES 2
Posted on December 26, 2016 at 15:19

Make sure you have adequate stack space to support the function/call trees.

Determine stack usage/depth by putting a recognizable character in there, and measure/view periodically.

The error suggests you are trashing or overwriting memory structures/objects used by the file system. Make sure you are not overwriting/overbounding buffers.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on December 27, 2016 at 07:57

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6r1&d=%2Fa%2F0X0000000bwm%2FH5o9gqpuyZSo26QWmX_IIpZR_aAHOIrkI8iFw2zHDLk&asPdf=false