2019-10-10 01:10 AM
Hello
I have interfaced sd card with controller STM32F779BI
i have write text file in sd card but i could not see at what time file is written to sd card doesn't show in properties of that text file
is this is possible , if yes then how can i do that ?
Best Regards
Dipak Garasiya
2019-10-10 01:54 AM
You should implement the get_fattime() function. This function should return the current date and time from your RTC packed as bitfields in a 32-bit integer.
2019-10-10 03:20 AM
thanks for reply @berendi
2019-10-10 03:21 AM
thanks again for giving me suggestion
2022-02-07 05:07 AM
Thanks a lot also!!!
I implement that:
DWORD get_fattime(void)
{
/* USER CODE BEGIN get_fattime */
RTC_TimeTypeDef sZeit;
RTC_DateTypeDef sDatum;
DWORD attime;
HAL_RTC_GetTime(&hrtc, &sZeit, RTC_FORMAT_BIN);
HAL_RTC_GetDate(&hrtc, &sDatum, RTC_FORMAT_BIN);
attime = (((DWORD)sDatum.Year - 1980) << 25)
| ((DWORD)sDatum.Month << 21)
| ((DWORD)sDatum.Date << 16)
| (WORD)(sZeit.Hours << 11)
| (WORD)(sZeit.Minutes << 5)
| (WORD)(sZeit.Seconds >> 1);
return attime;
/* USER CODE END get_fattime */
}
Works very well...