It may be due to the dimension of
char TxFileName[11];
This is really only room for ten characters since there must be a zero byte to terminate a string.
This string requires 12 bytes when you include the zero byte.
char TxFile[] = "GR_TX00.csv";
This will overwrite an extra byte somewhere.
strncpy(TxFileName,TxFile,sizeof(TxFile));
The same is true for RX files. This may not be the open problem but it will bite at some point.