Hello all,
I have noticed that a delay appear periodically when writing SD card for example, I have something that the following code
int iNumbers=10; //Size of the data I want to save int iTime=5; //iTime the size of the time corresponding to the value int8_t *size=malloc(sizeof(*size)); *size=iNumbers+iTime; for(int i=0; i<1000; i++){ char * buffer = malloc((iNumbers+iTime)*sizeof(*buffer)); get_value_and_write_into_buffer(buffer); f_write(&file, buffer, *size, (UINT *) &bytes_written); //function to write on SD card }
Unfortunately, I have a jump into the values when looking at the time written on the SD card at the end of the program. The longer the data is, the closer the discontinuous time will be. If iNumbers=5; I have a jump every 70 loop increments over i and if iNumbers=15; it will be every 20 loop increments.
Obviously I don't have any problem, if I save the 1000 data into a big array and write it after on the SD card. In this second case the clock is continuous. Therefore the only possible reason is something happen when writing the data.
Do you have any suggestion with what I am struggling with
Thank you for your help !