Hi Seattle Food Geek,
I just notice that the order of the calls is incorrect:
[*][color=rgb(0,0,0);]daq[/color][color=rgb(102,102,0);].[/color][color=rgb(102,0,102);]FatFs[/color][color=rgb(102,102,0);].[/color][color=rgb(102,0,102);]CloseFile[/color][color=rgb(102,102,0);]([/color][color=rgb(0,0,0);]fileId[/color][color=rgb(102,102,0);]);[/color]
[*][color=rgb(102,0,102);]Debug[/color][color=rgb(102,102,0);].[/color][color=rgb(102,0,102);]Print[/color][color=rgb(102,102,0);]([/color][color=rgb(0,136,0);]"file closed"[/color][color=rgb(102,102,0);]);[/color]
[*][color=rgb(0,0,0);]daq[/color][color=rgb(102,102,0);].[/color][color=rgb(102,0,102);]FatFs[/color][color=rgb(102,102,0);].[/color][color=rgb(102,0,102);]SyncFile[/color][color=rgb(102,102,0);]([/color][color=rgb(0,0,0);]fileId[/color][color=rgb(102,102,0);]);[/color]
[/list]
Closing the file invalidates the fileId, and it should not be used afterward.
[color=rgb(102,102,0);font-size:14px;]Just call SyncFile() before closing the file and things should be OK [/color]
I hope this helps.
-Fabien.