AnsweredAssumed Answered

f_utime FATFS wrong time and date

Question asked by rossi.giovanni on Jun 27, 2016
Latest reply on Jun 27, 2016 by Rygel.Troy1818
Hi .
I'm using FatFS on SDCARD with STM32F40x.

I call f_utime after closing a file that  I create.

I followed exactly this post

f_utime returns FS_OK = 0 but when I insert my SDCARD on my PC and I read the file I created , I find the date and time of file completed wrong (in Windows I don't see last modified field, in Total commander I see wrong date like 1/1/2096)

I verified that this instructions are correct

fno.fdate = (WORD)(((RTC_years1 - 1980) << 9) | RTC_months1 << 5 | RTC_daysm1);
    fno.ftime = (WORD)(RTC_hours1 << 11 | RTC_minutes1 << 5 | RTC_seconds1 / 2);

in debug I stop at this point and manaully check fdate and ftime: they are correct

return f_utime(obj, &fno);  //returns 0 -> ok

Any ideas?