Where to get a COMPLETE list of FIT profile and message definitions?

I've written a tool to convert FIT files to GPX some years ago which does not work with the newest generation of Garmin devices.

The FIT files seem to contain the message type 327 (0x147) which is not seen on the latest list (Profile.xlsx in the FitSDKRelease_21.84.00 archive). So I am unsure if the list is incomplete or I forgot to implement something in my code (still investigating if anything has changed in newer FIT file definitions)...

..

  • Hi km408,

    good luck next week with Norton Thumbsup

    And you are right.

    I checked my C# code and CRC value of the header will be decoded if header size is 14 bytes, but only characters '.FIT' will be checked. CRC value will never validated.

    000000   0E 10 83 00 CF 88 00 00 2E 46 49 54 00 00 40 00  .........FIT..@.

    So your fit header is ok (with crc = 0x0000) and only second file crc may be wrong.

    Best regards

    Roland

  • @PUFFOLINO....  Thanks for the details on the options.  My $2 (it used to be "2 cents", but with inflation....)....

    -----
    Re:  ``later I'll try to change that to export nothing / fit / gpx``

    -og (GPX) is an XML file.  I'm surprised.

    Because I could not get past the erroneous CRC check (and I cannot download any fix that you might have made; thanks, Norton!), I don't know what the normal output looks like.

    But the -d output that Roland posted seems to lend itself to a plain text file.

    In any case, I would be happy if -ot produced a plain text file.  And perhaps that's what you mean by "nothing".

    I cannot image your outputing a FIT file, since that is the form of the input.

    -----
    Re: ``if you find some bugs (the CRC thing for example)``

    Are you acknowledging that you have (had) a bug wrt CRC calculation and checking?

    I can now confirm that FitCSVTool.jar checks one or both CRCs.  When I hack the CRCs, FitCSVTool.jar complains.

    Egro, the CRCs in my FIT file are indeed correct, contrary to Roland's conclusion.  By "correct", I mean:  as Garmin intends them to be.  It is incongruous to conclude that the CRCs created by a Garmin product would be incorrect.

    The SDK Fit Protocol webpage (cited previously) is clear about the calculation of the header CRC.  It can be zero.  If it is nonzero, it is the CRC for just the first (12) bytes of the header, excluding the CRC of course.

    But I cannot find a canonical explanation of what bytes are included in the CRC at the end of the file.  Can someone point me to an statement either in the SDK or in the SDK webpage?

    Emperically, I conclude that the end-file CRC includes the file header (!) as well as the subsequent data bytes, possibly including the header CRC.

    That is based on the fact that when I hack only the header CRC, FitCSVTool.jar still complains of an error in the end-file CRC.  (The tool reports the byte number of the offending CRC.)

    But that is speculation.

    If you want to compare your end-file CRC calculation, download my FIT file (click here).  Ignore any preview errors and request to log in.  Just proceed to download.

    Unfortunately, the header CRC calculation cannot be confirmed, since that is zero in my file.

    But I think that if you get the end-file CRC right, the header CRC is a no-brainer.

    TIA for the tool.  I hope someday to actually try it (wink), with or without Norton's cooperation.

    -----
    PS.... Why would you use a hacker's compiler, when it seems that we can get legitimate compilers for free, IIRC?  Now I am suspicious of your "exe" file.  It might indeed contain malicious code inadvertently.  I scanned the file myself for suspicious strings (URLs; references to directories / folders).  But I'm not as clever as these hackers are.

  • Hi km408,

    I checked your activity mydata.fit and CRC value for this file is OK.

    I can process the complete file without any errors Blush

    ------

    But the -d output that Roland posted seems to lend itself to a plain text file.

    ------

    To create such a plain text file, I redirected all output of the program to a file:

    c:\Temp>Fit.exe -d5 9216376253_ACTIVITY.fit > log.txt

    OK, Norton isn't installed on my PC (and will never install it) Kissing smiling eyes

    Best regards

    Roland

  • The most important thing first: Fittool-update (Header CRC) I haven't had a file before which ignored the header CRC - anyhow it is allowed to do so, so I've fixed that. Now my tool should handle this - anyhow I don't know how the CRC will be calculated when the header is longer than 14 bytes, but we will see when such a FIT file will be available.

    GPX and so: a GPX file will (actually) be created in all cases, later on, I'll change this, the FIT option is still in my mind to do something like recovering a defect fit file.

    Concerning the compiler, I have bought this IDE around 20 years ago where no hacker did use this compiler. But meanwhile some do like they also use C# or whatever. Anyhow, antivirus companies don't spend the same time to find the differences within let's say 50 programs compiled with Purebasic  as checking 50.000 programs compiled with C#. So often a generic pattern is used and blocks all Purebasic programs. That's a little bit simplified but seems to be correct.

  • Re: ``Norton isn't installed on my PC (and will never install it)``

    Good thought!  I could simply uninstall Norton 360.  But I want to speak with them first to see if there is an alternative.

    -----
    Re: ``I can process the complete file without any errors``

    Great.  I suspect that PUFFOLINO is right, and my problem with Norton is related to his use of a "hacker" compiler.

    I wish that PUFFOLINO would use a "standard" compiler.  (Or perhaps I should say "more recent" standard compiler, like MSFT Visual.  I just say PUFFOLINO's follow-up that was posted while I was typing.)

    I am desperate to get an uninterpreted presentation of the FIT data (with __optional__ interpretation like PUFFOLINO's -d options).  I have issues that I want to discuss in this forum -- issues that I might want to take to Garmin for consideration.

    But I still struggle with the description and use of the FIT SDK.  I'm not going to solve my "denseness" any time soon.  And my manual breakdown of the data records based on a hex dump is tedious, if not error-prone.

    Roland, if it isn't too much of an imposition, I wonder if you could upload the output(s) of PUFFOLINO's tool with the "mydate.fit" file to a file-sharing website, since you've done all but the upload already. Ideally, with the -d5 option.

    Thanks for your indulgence, either way.

    -----
    And getting back on topic, I still have the same question that PUFFOLINO posted initially.  So far, I have not found the kind of canonical documentation that I need to understand the FIT SDK.

    For example, I now know that "local level" code 9 means "activity", as presented by FitCSVTool.jar.  But I cannot find that in any of the SDK files.  If it's in Profile.xslx, I have overlooked it.  I see "activity" all over the place; but none associated with a "local level" code of 9.

    Can someone point me to that specific documentation?  That might help find other similar documentation.

    TIA.

  • Hi PUFFOLINO and km408,

    I checked the program with 'Microsoft Defender Offline' and no thread was detectedInnocent

    And I wish that PUFFOLINO would use a "standard" compiler. isn't a solution, because Norton is the problem at the moment!!!

    I'm using Microsoft Visual Studio 2019 at my customer site since several years and once a month ( minimumTired face ) Norton detect my C# programs as a thread - SORRY Scream

    Roland

  • I'll stay with my compiler - it's a brilliant product of a tiny european company which does not have the money to convince all the Norton's to do a better virus detection. Maybe I'll do compile the Fit Tool with the latest compiler release (will install it the upcoming week)...

    ...but before doing so - is there anything you'd like to have changed in the tool? Maybe I'll do some final polishing but after that I need my time for some other projects (for instance Screeny and ScreenyFont are tools to help making Connect IQ fonts and programs, Foxrunner is doing automatic backups of activities).

    Upside down

  • FIT Version 1.0

    Final version, compiled with standard compiler (32 and 64 bit) and the Gnu C compiler. This will give Norton's antivirus program some options ;-)

    Apropos options, I've changed or enhanced some of them, here is some information what has changed:

    -o (output file): without this option,  no conversion is done; -og generates a 'gpx' file, -og a 'txt' file and -of a 'fit' file (a '!' is added to the filename); adding a 'b' to the option (e.g. -ogb) tries to make a 'bak' file

    -f (filter): allows to focus on data or definition content; example: fit.exe fitfile.fit -d2 -fe

    -v (range): should be combined with option 'd'; allows to inspect a part of the file only; offset values can be decimal (e.g.256) or hex (e.g. $100); example: fit.exe fitfile.fit -d6 -v100-200

    Have fun!