2009-12-22 08:18 PM
STM8A checksum calculation error with COSMIC C-Compiler
2011-05-17 06:06 AM
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!2011-05-17 06:06 AM
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! ;)