Hello!!! Sir, No effect with this.
And i found a very new problem, write this code.
Code:
int main (void)
{
FATFS fs;
FIL fdst;
FRESULT res;
UINT numread;
DWORD size;
unsigned char i = 0;;
unsigned char buffer[] = "This is a text file.";
// Enable optimal performance
INTEnableSystemMultiVectoredInt();
SYSTEMConfigPerformance(GetSystemClock());
mOSCSetPBDIV(OSC_PB_DIV_1); // Use 1:1 CPU Core:Peripheral clocks
//Initialize the disk
disk_initialize(0);
f_mount(0,&fs);
for(i=0;i<3;i++)
{
res = f_open(&fdst,"james.txt",FA_WRITE | FA_OPEN_ALWAYS);
size = (&fdst)->fsize;
res = f_lseek(&fdst,size);
res = f_write(&fdst,&buffer,21,&numread);
f_close(&fdst);
}
res = f_open(&fdst,"essel.txt",FA_WRITE | FA_OPEN_ALWAYS | FA_READ);
res = f_write(&fdst,&buffer,21,&numread);
f_close(&fdst);
f_mount(0,NULL);
while(1);
}
I append code same text three times, in a single run and it works.
In file james.txt the buffer text was written three times.
But when i restart the unit, and then again see the memory card data. all the things are corrupted.
It means that restarting of unit is creating some problem.
If the controller is operating then appending is okay, but after power-off appending is not working.
- - - Updated - - -
Hello!!! Sir, No effect with this.
And i found a very new problem, write this code.
Code:
int main (void)
{
FATFS fs;
FIL fdst;
FRESULT res;
UINT numread;
DWORD size;
unsigned char i = 0;;
unsigned char buffer[] = "This is a text file.";
// Enable optimal performance
INTEnableSystemMultiVectoredInt();
SYSTEMConfigPerformance(GetSystemClock());
mOSCSetPBDIV(OSC_PB_DIV_1); // Use 1:1 CPU Core:Peripheral clocks
//Initialize the disk
disk_initialize(0);
f_mount(0,&fs);
for(i=0;i<3;i++)
{
res = f_open(&fdst,"james.txt",FA_WRITE | FA_OPEN_ALWAYS);
size = (&fdst)->fsize;
res = f_lseek(&fdst,size);
res = f_write(&fdst,&buffer,21,&numread);
f_close(&fdst);
}
res = f_open(&fdst,"essel.txt",FA_WRITE | FA_OPEN_ALWAYS | FA_READ);
res = f_write(&fdst,&buffer,21,&numread);
f_close(&fdst);
f_mount(0,NULL);
while(1);
}
I append code same text three times, in a single run and it works.
In file james.txt the buffer text was written three times.
But when i restart the unit, and then again see the memory card data. all the things are corrupted.
It means that restarting of unit is creating some problem.
If the controller is operating then appending is okay, but after power-off appending is not working.