2023-05-15 04:43 AM
I do have RTC working and SD, I found this code
FRESULT set_timestamp (char *obj)
{
FILINFO fno;
HAL_RTC_GetTime(&hrtc, &sTime, RTC_FORMAT_BIN);
HAL_RTC_GetDate(&hrtc, &sDate, RTC_FORMAT_BIN);
int hour = sTime.Hours;
int min = sTime.Minutes;
int sec = sTime.Seconds;
int month = sDate.Month;
int mday = sDate.Date;
int year = sDate.Year;
year+=2000;
fno.fdate = (WORD)(((year - 1980) << 9) | month << 5 | mday);
fno.ftime = (WORD)(hour <<11 | min <<5 | sec/2 );
f_utime(obj, &fno);
}
but it keeps saying undefined symbol f_utime
I see that ff.c contain this function, I do not know what the problem is
2023-05-15 07:29 AM
Please precise which product you are using.
Regards.
2023-05-15 09:34 AM - edited 2023-11-20 05:27 AM
in fatfs by chan... ->
http://elm-chan.org/fsw/ff/doc/utime.html
+++ set in cube: fatfs -> set defines !!! ->
2023-05-15 09:48 AM
Removed MPU tag, betting your not using those.
PLEASE always state the MODEL/FAMILY of MCU you're using in the TOP POST, it's not hard and conveys useful contextual information.
Check how you're building / configuring FatFS
Make sure you have clock info handled in DISKIO.C unpack a SysTick counter into human / calendar centric data, or use RTC, or whatever..
2023-05-15 03:17 PM
it is custom board STM32L4S9ZIT6, as I mentioned everything is working fine calendar, SD card is working fine. Created in CubeMX 6.8.0
2023-05-15 03:19 PM
I already found this link in Google, there is nothing to help me solve the problem.