Hello all,
When preforming mutch file writes to a ascii text file on the SD-card some lines get corrupted. It seems I get into trouble when passing the sector size limit of 512 bytes.
What is wrong here?
This is my writing code:
sprintf(strMessage, "%04x %02x %02x %02x %02x %02x %02x %02x %02x 02x\r\n", RxMessage.StdId, RxMessage.DLC,RxMessage.Data[0],RxMessage.Data[1],RxMessage.Data[2],
RxMessage.Data[3],RxMessage.Data[4],RxMessage.Data[5],RxMessage.Data[6],RxMessage.Data[7]);
for(y=0; y<500; y++)
{
if (!SDCardfault)
{
if (FS_WriteFile(&file_info,strMessage,&count,strlen(strMessage))
{
SDCardfault = 1;
}
}
}
This is actually writen into the file:
The lines that jump out are wrong.
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
00000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 0 00 00 00 00 000000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00
0000 00 00 00 00 00 00 00 00 00