The bug appeared again. Formatted cards a few times, did not fix anything. Did some more testing.
So, this works fine:
FILE* f = FIO_CreateFileEx("A:/testb.log");
for (int i = 0; i < 1000; i++)
FIO_WriteFile(f, YUV422_LV_BUFFER_1, 512);
Any number lower than 512 (tried 511, 256, 128, 64, 16, 15) results in failure (ERR02 when taking a picture). 513 is bad, 1024 is OK, 768 is bad.
So, the size argument should be always multiple of 512?!