SD FAT32: Write failed with err 28 (no space left on device)

25 views
Skip to first unread message

Oleg Evseev

unread,
Sep 6, 2020, 1:14:55 PM9/6/20
to NuttX
Hi all,

I'm working with stm32f7 custom board and px4 firmware, but my concerns are with the NuttX FAT32 driver. I have an issue. PX4 logger module writes high rate data to SD card successfully awhile, until at some point write func return error 28 (“No space left on device”) while there is a lot of free space on a card (29GB out of 30GB).

I had this error several times on two different SD-cards. I don't do a lot of tests, but it seems that SanDisk Extreme Pro is less prone - it can write 100+ Mbytes files without errors, while SanDisk Extreme usually breaks a little earlier.
The board is on the table, no vibrations (at least any significant).

I dig a little and can see that 'fat_write' try to extend the current cluster by one calling 'fat_extendchain' func that on existing chain extending verifies that this is a valid cluster by examining its start sector, but 'startsector = fat_getcluster(fs, cluster);' returns 0:

     else if (startsector < 2)
        {
          /* Oops.. this cluster does not exist. */
          return 0;
        }

In 'fs_buffer' there is indeed 0 for this fatindex (see picture).
изображение.png

I didn't dig much in the driver and fat32 itself. What should I check, where it is useful to set breakpoints, etc.?

Can any hardware issues be the reason for such error theoretically?
Can any previous power shutdown and unfinished writings (in fact shutdowns can be on every launch and I already have several corrupted files), breaks FAT system itself in that way it can lead to this exact error for new sessions?

Thanks in advance for any help!

---
With regards, Oleg.


hartman...@gmail.com

unread,
Sep 6, 2020, 9:00:56 PM9/6/20
to NuttX
On Sunday, September 6, 2020 at 1:14:55 PM UTC-4 wrote:
I'm working with stm32f7 custom board and px4 firmware, but my concerns are with the NuttX FAT32 driver. I have an issue. PX4 logger module writes high rate data to SD card successfully awhile, until at some point write func return error 28 (“No space left on device”) while there is a lot of free space on a card (29GB out of 30GB).

Hi Oleg,

Communications about NuttX have moved to our mailing lists at the Apache Incubator. You'll get much more response there. Please see the page: https://nuttx.apache.org/community/. The mailing list is dev (at) nuttx.apache.org.

Thanks,
Nathan

Oleg Evseev

unread,
Sep 7, 2020, 3:52:44 AM9/7/20
to NuttX
Hi Nathan,

Oh, my bad, I know about moving, just type nuttx and gmail automatically suggested the old group, didn't recheck. Thanks for pointing that out!

пн, 7 сент. 2020 г. в 04:00, hartman...@gmail.com <hartman...@gmail.com>:
--
This group has moved to the Apache Foundation:
http://nuttx.incubator.apache.org/community/
---
You received this message because you are subscribed to the Google Groups "NuttX" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nuttx+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/356cb34a-4640-452d-a559-51eb1d60d356n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages