fflush doesn't work on LPC23xx

Hi
I have problem on fflush in rl-arm4.13.

fflush doesn't work at all and always zero is result of this function. no data will save on SD card after this function.

but fclose works well.

another problem is about maximum size of file in FAT32, I know it is 0xFFFFFFFF or 4GB byte but with flashFS when the program exceed this size in 1 file there is no any error and continue everything
And in my PC I could see the used memory space in this situation for example is more that 4GB but I have one file which is 4GB in size and it's crashed

Indeed I'm using 16GB SDHC transcend Class10

my code is very simple such as below:

while (1){
if (ferror(f)) break;
fwrite (&buf[0], 1, BUF_SIZE, f);
if (fflush(f)) break;
}
fclose(f);
printf("error has been accured\r\n");

what shall I do?
please help me

thanks

Parents
  • One thing has dropped out
    I found some functions in retarget.c file in flashfs sample code(and RTA_agent mode), I'm using COM0 and printf as a serial communication.

    Do they have any effect on my problem or not?

    I know functions of stdio.h should retarget on special function such as putchhar and ... but here when we have two destination 1.serial port 2.file system .... are they compatible in a same place and project(I think yes because except fflush all functions are properly working, but I think fflush need to has some manipulation in retarget method)

    If anybody could help me I'll appreciate him.

    thanks in advance

Reply
  • One thing has dropped out
    I found some functions in retarget.c file in flashfs sample code(and RTA_agent mode), I'm using COM0 and printf as a serial communication.

    Do they have any effect on my problem or not?

    I know functions of stdio.h should retarget on special function such as putchhar and ... but here when we have two destination 1.serial port 2.file system .... are they compatible in a same place and project(I think yes because except fflush all functions are properly working, but I think fflush need to has some manipulation in retarget method)

    If anybody could help me I'll appreciate him.

    thanks in advance

Children
More questions in this forum