GENERAL: CYGNAL DOWNLOAD VIA DLL AFFECTS CHECKSUM
Information in this article applies to:
I'm working with Cygnal C8051F006 and my application calculates the flash checksum. Every time I download the same source code using Keil IDE ( via Cygnal DLL ), I get a different checksum value. It appears that the flash download via Keil IDE does not fully erase the whole flash before the download. Is this correct?
Yes, the DLL does not erase all of the code space on each program download. This is by design.
A download operation starts by reading the 512-byte flash sectors that contain an address included in the code image to be loaded. It then modifies only the bytes at the addresses included in the code image. Then, only the flash sectors that were read are erased and reprogrammed. The net effect is that only bytes that are part of the new code image to be downloaded are changed. All other addresses retain their previous values -- even those in a re-programmed flash sector.
This allows users to incrementally download code (e.g. load a library of routines or boot loader to one location in code space and then, later, load additional application code to another location).
To ensure all of the code space is erased before a download, you may use a stand-alone programming utility to erase code space or create a code image that uses every byte of code space, setting "unused" bytes to 0xFF.
Last Reviewed: Tuesday, April 20, 2004
of your data.