Fixing a corrupt TCX file – The easy way

Anyone who has a Garmin cycle computer for any length of time seems to experience this, and it is a pain to fix.

Some Background

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.

20 thoughts on “Fixing a corrupt TCX file – The easy way”

  1. Thanks for the article. I tried the easy way, did not work. Resorted to the hard way using Firstobject XML editor. Fixing the bugs in the TCX file took about 5 minutes. Fortunately, I have a programming background.

  2. You sir are a champion. Thank you so much! This is so simple to do and it saves you from losing a really good ride too!

  3. @Raoul
    Ah, I’ve only seen that once. Best bet would be to clear out some of your older tcx files from the device. I normally empty my 705 every week or two and haven’t seen this issue in months.

    If that doesn’t work then you’ll need to format the device to clear everything. You will lose the last ride however.

    To format, write down all your settings; displayed data fields etc
    Plug it into your computer
    Right click on the Garmin and hit format.
    Type FAT32, label GARMIN
    Create a folder called “Garmin” on the formatted drive and copy in an older firmware
    Disconnect and let it re-flash the device
    Once complete, run the firmware updater and bring it up to the latest version.

    You can get the older firmwares from garminedge705.wikispaces.com/space/content?showType=files

  4. Thanks for your info. With some new info, now I think my problem is something different than this topic describes. My TCX file doesn’t contain any GPS data at all. If I open it in XML editor there is no node at all, only distance/speed and that kind of info. Wich is weird because I do see my track on my device.

    Do you have any idea how I can import it WITH the GPS data?

  5. Yes that is what I was hoping for. But I deleted al info on my Garmin except for this specific one and still it says memory full when I want to create a course. Probably because it’s a very long track of 5 hours and I didn’t had it on smart recording. 🙁

  6. @Raoul
    Last thing to try would be to remove the other rides via the history option on the 705. Just removing the tcx doesn’t remove data from the other location the garmin stores it.

    It is able to handle longer rides too. I’ve done some 8hr + rides with per second and power meter.

  7. @Stephen
    That’s what I did. Removed it on my Garmin device via the history option. I have a 205 by the way. I wouldn’t know any other way..

    Is my garmin supposed to show up in my explorer? Because it doesn’t. I always import files using Garmin Training Center.

  8. Another weird thing is, the TCX file doesn’t seem to hold any GPS info, but it does seems to know where I was somehow, because the map in Garmin Training center shows the right location, only without a track..

  9. 205 is a much more restricted version of the 705. The 705 shows up in Explorer as a removable device and works right from there. Lets you fix problems in other ways. From a similar problem on my 310 through training center, I just gave up as it kept refusing to properly sync.
    Not much else I can offer I’m afraid.

  10. Thanks ever so much. I followed your easy route and once the file was saved by TCX converter I uploaded straight to Strava with no problems. My Garmin 705 only saves laps now so it’s had it’s last ride today. It’s the bin for you now 705!!

  11. AWESOME – Fixed my 94km ride file using your method. I’ll re-post this on my blog at some point.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.