This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Write SD Card Fail

av_write_frame();

write stream to SD Card(8G,Class 6, or 4G,Class 4),print the error informations:

mmcblk0: error 2 transferring data
end_request: I/O error, dev mmcblk0, sector 30871
end_request: I/O error, dev mmcblk0, sector 30872
end_request: I/O error, dev mmcblk0, sector 30880
end_request: I/O error, dev mmcblk0, sector 30888
end_request: I/O error, dev mmcblk0, sector 30896


FAT: Filesystem panic (dev mmcblk0p1)
invalid access to FAT (entry 0x0f010000)
FAT: Did not find valid FSINFO signature.
Found signature1 0x52520000 signature2 0x72720000 (sector = 1)
FAT: Filesystem panic (dev mmcblk0p1)
invalid access to FAT (entry 0x0f010000)


FAT: Did not find valid FSINFO signature.
Found signature1 0x52520000 signature2 0x72720000 (sector = 1)
FAT: Did not find valid FSINFO signature.
Found signature1 0x52520000 signature2 0x72720000 (sector = 1)

if I use the SD Card(16G,Class 10 or 32G,Class 10),it works well.

  • Bruce,

    Share complete boot logs. Was card getting detected properly. Keep your application aside. Are you able to perform any other writes/read to/from the card?

  • SD detected OK, just only write,not other operation.

    I write a demo.

    #include <locale.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>

    int main(int argc, char **argv)

    {
    int nTime = time(NULL);
    int nCnt = 0;
    char sBuf[1024] = {0};
    for(; nCnt < sizeof(sBuf)-1; nCnt++)
    sBuf[nCnt] = '1';
    sBuf[sizeof(sBuf)-1] = '\0';
    //memset(sBuf, "1", sizeof(sBuf));
    nCnt = 0;
    printf("=====SD Write Demo=Time=(%d)==\n", atoi(argv[1]));
    FILE *fp = fopen("/mnt/mmc/ipnc/time44.avi","a+");
    if(!fp)
    printf("==========Open File Failed============\n");
    printf("buf:%s\n", sBuf);
    while(1){
    if(nCnt++ > 102400)
    break;
    printf("==========Write:%d============\n", nCnt);
    fwrite(sBuf, 1, strlen(sBuf), fp);
    if(atoi(argv[1]))
    usleep(atoi(argv[2]));
    }

    nTime = time(NULL)-nTime;
    printf("======Time:%d====\n", nTime);
    printf("rate:%f\n", (float)100/nTime);
    fclose(fp);
    return 0;
    }

  • Bruce,

    Can you attach the complete kernel logs during bootup and while trying the application?