cancel
Showing results for 
Search instead for 
Did you mean: 

STM8A checksum calculation error with COSMIC C-Compiler

rolf
Associate II
Posted on December 23, 2009 at 05:18

STM8A checksum calculation error with COSMIC C-Compiler

2 REPLIES 2
rolf
Associate II
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!

rolf
Associate II
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! ;)