You can find out how many bytes are in the Float. The other best option so that your data can be readable is to convert it to string, use the function sprintf() to convert Float to string then use The f_printf function writes formatted string to the file.
Hi. Good to hear that at least you are managing to write data correctly. Unfortunately our knowledge with winimage is very limited. You can’t advise you why the file gets corrupt. Maybe you can get a better response from winimage Forum or support.
How are you simulating the SD card with MPLAB X IDE?