Incorrect checksum when debugging
Technical Note 48021
When a software breakpoint is set, a Break instruction will be set in flash memory. This will make a checksum calculation over that memory range fail.
Hardware breakpoints or no breakpoints at all should be used if debugging checksum algorithms.
To get control of the usage of the hardware breakpoints check Technical Note 31070.
Specifics for different devices
Atmel AVR devices
- In Xmega devices, software breakpoints are regularly used. This makes it impossible to calculate a correct checksum in debug mode.
- DebugWIRE only has software breakpoints. You can not debug checksum algoritms for devices that use debugWIRE.
Specifics for some debug probes
Using J-Link in IAR Embedded Workbench for ARM
The J-Link driver can set 'flash breakpoints', and those must be disabled.
When the J-Link Control Panel is open (for example when debugging) the flash breakpoints can be disabled at : Settings > Flash breakpoints.
Using a FET-probe in IAR Embedded Workbench for MSP430
IAR Embedded Workbench for MSP430 version 5.51 (and newer) has flash breakpoints enabled by default. (So if all hardware breakpoints are in use, then this type of problem can occur).
All product names are trademarks or registered trademarks of their respective owners.