Update:

My purpose is to write data to a file in a thread. With append. Writing once
works.

 

int nbytesi;

nbytesi = write(fd_mmcsd, g_testmsg, strlen(g_testmsg));

 

if (nbytesi < 0)

    {

       printf("write_test_file: ERROR failed to write to %s, errno=%d\n",

                   "/dev/mmcsd0", errno);

    }

 else

   {

      printf("write_test_file: wrote %d bytes to %s\n", nbytesi,
"/dev/mmcsd0");

    }

   close(fd_mmcsd);

 

sleep(2); <-- when putting in a sleep it all breaks!!!! 

 

nbytesi;

nbytesi = write(fd_mmcsd, g_testmsg, strlen(g_testmsg));

 

if (nbytesi < 0)

    {

       printf("write_test_file: ERROR failed to write to %s, errno=%d\n",

                   "/dev/mmcsd0", errno);

    }

 else

   {

      printf("write_test_file: wrote %d bytes to %s\n", nbytesi,
"/dev/mmcsd0");

    }

 

   close(fd_mmcsd);

 

 

 

Van: disruptivesolution...@gmail.com <disruptivesolution...@gmail.com> 
Verzonden: maandag 13 april 2020 12:06
Aan: dev@nuttx.apache.org
Onderwerp: SDIO MMCSD card is not writing/reading files anymore it does
mount CMD24 -5 error

 

Hi All,

 

I had the SD card written with using Nuttx, but then it stopt writing and
reading to and from the SD card. I get a CMD24 error:

mmcsd_eventwait: ERROR: Awakened with 14


mmcsd_writesingle: ERROR: CMD24 transfer failed: -5

 

It seems to think it wrote bytes, but no file there. What am I doing wrong?
Where could I find more info?

 

Debug log:

mmcsd_open: Entry


mmcsd_geometry: Entry


mmcsd_geometry: available: true mediachanged: true writeenabled: true


mmcsd_geometry: nsectors: 248320 sectorsize: 512


mmcsd_read: startsector: 0 nsectors: 1 sectorsize: 512


mmcsd_readsingle: startblock=0


mmcsd_readsingle: offset=0


fat_checkbootrecord: WARNING: Signature: aa55 FS sectorsize: 0 HW
sectorsize: 512    

fat_mount: Partition 0, offset 446, type 6


mmcsd_read: startsector: 97 nsectors: 1 sectorsize: 512


mmcsd_readsingle: startblock=97


mmcsd_readsingle: offset=49664


fat_mount: FBR found in partition 0


fat_mount: FAT16:


fat_mount:      HW  sector size:     512


fat_mount:          sectors:         248320


fat_mount:      FAT reserved:        1


fat_mount:          sectors:         248223


fat_mount:          start sector:    98


fat_mount:          root sector:     160


fat_mount:          root entries:    512


fat_mount:          data sector:     192


fat_mount:          FSINFO sector:   0


fat_mount:          Num FATs:        2


fat_mount:          FAT sectors:     31


fat_mount:          sectors/cluster: 32


fat_mount:          max clusters:    7754


fat_mount:      FSI free count       -1


fat_mount:          next free        0


succes mount!


mmcsd_geometry: Entry


mmcsd_geometry: available: true mediachanged: false writeenabled: true


mmcsd_geometry: nsectors: 248320 sectorsize: 512


mmcsd_read: startsector: 160 nsectors: 1 sectorsize: 512


mmcsd_readsingle: startblock=160


mmcsd_readsingle: offset=81920


mmcsd_writing_daemon started


 

mmcsd_geometry: Entry


mmcsd_geometry: available: true mediachanged: false writeenabled: true


mmcsd_geometry: nsectors: 248320 sectorsize: 512


mmcsd_write: sector: 160 nsectors: 1 sectorsize: 512


mmcsd_writesingle: startblock=160


mmcsd_writesingle: offset=81920


mmcsd_eventwait: ERROR: Awakened with 14


mmcsd_writesingle: ERROR: CMD24 transfer failed: -5


fat_currentsector: position=0 currentsector=-22 sectorsincluster=32


write_test_file: wrote 15 bytes to /dev/mmcsd0


 

mmcsd_geometry: available: true mediachanged: false writeenabled: true


mmcsd_geometry: nsectors: 248320 sectorsize: 512


mmcsd_write: sector: 4294967274 nsectors: 1 sectorsize: 512


mmcsd_writesingle: startblock=-22


mmcsd_writesingle: offset=-11264


mmcsd_eventwait: ERROR: Awakened with 14


mmcsd_writesingle: ERROR: CMD24 transfer failed: -5

Reply via email to