Thank you Dmitri but, yes: CONFIG_FS_FATTIME is enabled.

I have found what the "issue" is:

1. My RTC hadn't been working. I'd though faulty board, but it was
   because of a bug in the AT91 bootloader code back some-when. It was
   fixed, but I didn't know it was broken at the time I updated my
   bootloader to "latest" last year.
2. Because of that, when writing Javascript code for a web interface
   that used file date/time stamps for files saved on my NuttX board I
   assumed the incorrect file timestamps were because of the broken
   RTC. Nope. I fixed the RTC issue but still no cigar.
3. Because NuttX ls -l gave no timestamps I then assumed CONFIG error
   or similar until it was pointed out yesterday that NuttXls -l does
   not print file timestamps. Doh!
4. JavaScript assumes the Date object is in milliseconds
5. NuttX uses 1 second timestamps it seems.
6. If I change my Javascript to multiply the NuttX timestamp by 100 I
   get correct timestamps for FAT and LittleFS. Yay!

Frustrating but simple!!

I thought I'd seen a Kconfig setting to change the NuttX timestamp increment to be in milliseconds but I can't find it now. No matter, 1 second is fine.


On 24/09/2025 07:01, Dmitri Shilov wrote:
Do you have CONFIG_FS_FATTIME enabled?

Regards,
Dmitri Shilov.


-------- Original Message --------
On 2025-09-23 9:26 a.m., Tim Hardisty<[email protected]> wrote:

  I send syslog output to an MTD formatted with LittleFS. The syslog
  output itself has correct timestamps from my board's RTC, but I must be
  doing something dumb either with NuttX or LittleFS as the syslog file
  itself has a default timestamp of 21st January 1970 regardless of when a
  new file is created.
And an 'ls -l' at NSH doesn't show timestamps either? Can someone advise? I'm sure I'm not doing something REALLY obvious!! PS - same is true of a LittleFS formatted EEPROM device too, and also
  for a FAT formatted ramdisk...

Reply via email to