Keil Logo

ULINK: FLASH DOESN'T ALWAYS LOAD


Information in this knowledgebase article applies to:

  • MDK-ARM All versions

PROBLEM

I use my own bootloader which is stored at 0x0-0x4FFF in Flash on an LPC2148. My application loads at 0x5000 and up. Everything was working fine until my application became larger than 196K. Now, when I try to load an updated version of my application I get:

Erase Done.
Programming Done.
Contents mismatch at: 00030000H (Flash=04H, Required=07H)
Contents mismatch at: 00030001H (Flash=00H, Required=0DH)
Contents mismatch at: 00030002H (Flash=04H, Required=FFH)
.
.
.

The LPC2148 I use has 512K of Flash so the program should fit. If I completely erase the chip, then reload my bootloader, the application will load without errors. But when I make another application change and try to load without a Full Chip Erase, I get the same error. What causes this odd behavior?

CAUSE

You are trying to use the Start parameter of the Flash Download Setup dialog to control where your application program loads by setting it to 0x0005000 instead of 0x00000000. This can cause the wrong sectors to be erased prior to programming.

SOLUTION

Change the Start parameter to 0x00000000. Then, make sure your project links your code and loads it at 0x5000 and up (Options for Target, Target tab). Subsequent loading your application code should not affect your bootload code.

The Start parameter is used for mapping, sector programming and erasing, but not for partial programming. It is usually only changed to define the mapping of external Flash. For internal Flash, it should be mapped according to the data sheet for the device. For LPC2xxx devices, this should be 0x00000000.

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Wednesday, January 20, 2010


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.