Skip to main content
Visitor II
December 23, 2009
Question

STM8A checksum calculation error with COSMIC C-Compiler

  • December 23, 2009
  • 2 replies
  • 828 views
Posted on December 23, 2009 at 05:18

STM8A checksum calculation error with COSMIC C-Compiler

    This topic has been closed for replies.

    2 replies

    rolfAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:06

    Hi,

    I like to find out how long the COSMIC _checksum() and _checksum16() routine takes for 32k code. To figure out I made a test project but I struggled already at the beginning. Even an empty project caused a checksum error because the calculated checksum at runtime does not match with the one calculated by the compiler at compile time.

    Has anybody ran successful the COSMIC checksum calculations?

    Thanks for your hints!

    rolfAuthor
    Visitor II
    May 17, 2011
    Posted on May 17, 2011 at 15:06

    Problem solved!

    It's simply a debugging problem but different than expected!

    Working with the debugger (SWIM mode) I put a breakpoint somewhere in my code but doing it with the debug module on the silicon it generates a SW breakpoint => so the code is changed on this specific address and the checksum calculation at runtime if different.

    Doing the same with all breakpoints removed => it works as expected!

    With the simulator and with the STICE Emulator mode also everything is fine because the breakpoints are implemented in a different way in that case.

    So we have to keep in mind: no SW breakpoints when checksum calculation is done! ;)