nRF52840
NCS 2.4.1
I am logging to the FS backend. All the files have a date of 12/31/21 11:00.
How do you give the file system access to UTC time?
I have a UTC time source and a timestamp getter (uint64_t currenttime(void)) that the log system uses. The timestamps for the log messages are correct, though I would like to change the format to show date, not just hours. Is there a way to change the format? But, my main concern is the file timestamps.
main.c
ret = log_set_timestamp_func(currenttime, 1); printk("log_set_timestamp_func() returned %d", ret);
prj.conf
# SD card CONFIG_DISK_ACCESS=y CONFIG_FILE_SYSTEM=y CONFIG_FAT_FILESYSTEM_ELM=y CONFIG_DISK_DRIVER_SDMMC=y #CONFIG_SD_LOG_LEVEL_DBG=y # Log to SD (does not support LOG_MODE_IMMEDIATE) CONFIG_LOG_BACKEND_FS=y CONFIG_LOG_BACKEND_FS_OUTPUT_TEXT=n CONFIG_LOG_BACKEND_FS_DIR="/SD:" CONFIG_LOG_BACKEND_FS_FILE_PREFIX="log" CONFIG_LOG_BACKEND_FS_FILES_LIMIT=5 CONFIG_LOG_BACKEND_FS_FILE_SIZE=4096 CONFIG_LOG_BACKEND_FS_OVERWRITE=y
also tried this:
sync_instant.local = k_uptime_get() / 1000; sync_instant.ref = now; // UTC, seconds since Epoch (1970) ret = timeutil_sync_state_update(&sync_state, &sync_instant); LOG_INF("Sync time. ret = %d", ret);
Is there a similar mechanism for the file system? Or a way to set UTC time for zephyr?
Mary