SD card library file naming limitation

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello

 

I am trying to save data files on SD card using Arduino Uno and SD card library. I noticed that there is some limitation related to file maximum name length. If I make the name exceed 8 characters the file is not created. 

 

why does this happen? and how can I save with longer file names?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

See the "File Naming" section at https://www.arduino.cc/en/Reference/SDCardNotes.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

thank you very much, this was very helpful

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Note that the limitation has nothing to do with the SD card itself:  it is a limitation of the FAT filesystem - as explained in the link.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

If you use switch to using FatFS you have two options. Either stick with 8.3 names (MYWORDS.TXT etc) or enable LFN (Long Filename Support). It does take quite a lot of flash space though as it needs character translation tables. LFN is a Microsoft thing and they famously sued TomTom for using it in a FAT system. So you may need to licence (or risk prosecution) but it then lets you use any name that is valid in the current Windows you are using.