Anyone who has a Garmin cycle computer for any length of time seems to experience this, and it is a pain to fix.
The TCX files are stored on the Garmin device in the History folder and are simply an xml file which logs data when needed assuming you use the smart recording. The problem is that occasionally, it doesn’t write all the data correctly or drops some data leaving you with a corrupt file. This used to happen whenever the device crashed, although they seem to have fixed that. Now the mapping functions just get to 100% and then sit there.
Fixing it – the hard way
The first time it happened, I simply broke open the TCX file and edited the xml to make it parse correctly. It did allow it to be imported into SportTracks although with some amount of data loss. Further attempts did show that the data loss is because it isn’t actually in the file.
If you are going for this approach watch out. VIM syntax highlighting is really slow. I did come across firstobject XML Editor (which is free) and can parse and reorganise the xml to let you find the line with the problem. Honestly Garmin, line 2 position 2014798 is quite hard to get to!
Since the data isn’t always in the TCX file, it can’t really be recovered properly. Yesterday for instance, it dropped over the laps up the hill we were climbing, pretty much loosing the only important section of the ride.
Fixing it – the easy way
Since I did need the data from yesterday, some more Google time was spent to try get things back. With lots of tests, I found a way that has restored the TCX back giving near perfect data. Simple and free too.
First, go into the menu, select training -> Courses -> Create New
Select the file that has the problem. Give it a name and hit mode again. It’ll save the file to the device
Copy this GPX to your computer. Go online and grab a copy of TCX Convertor. (I’d recommend donating if it works and you can)
Open the file in TCX Convertor, then with the export menu, export it as a TCX file choosing the option for history. This will regenerate the broken TCX file and save it out for you letting you import it into SportTracks or Garmins software. And best of all, all the points will return.
Why Garmins device can’t do this I don’t know. It stores the ride data somewhere else other than the TCX files and can create the course even when the TCX is missing huge sections. Either way, I’m glad I’ve found this and I hope it helps.