Keil Logo

ARM: verify errors when flashing NXP LPC device with ST-Link

Information in this knowledgebase article applies to:

  • NXP LPC device
  • ST-Link and possibly other 3rd party adapters


I'm using a NXP LPC device and try to download the software with the ST-LINK debugger. At the beginning everything seems to be fine but at the end some content is not fitting:

Erase Done.
Programming Done.
Contents mismatch at: 0000001CH  (Flash=4FH  Required=00H) !
Contents mismatch at: 0000001DH  (Flash=EFH  Required=00H) !
Contents mismatch at: 0000001EH  (Flash=FFH  Required=00H) !
Contents mismatch at: 0000001FH  (Flash=EFH  Required=00H) !
Verify Failed!

What is the problem here?


For many NXP LPC devices the exception vector location 7 (offset 0x0000001C in the vector table) contains the 2’s complement of the check-sum of table entries 0 through 6. This is a very NXP specific feature. The flashloader generates this checksum on the fly while programming. This causes the flashed content to be actually different at that locations compared to the programmed image. So, it is normal, that the ST-Link driver, that will never be aware of that, reports verify errors.


Debug drivers for µVision created by Keil (for the ULINK family, CMSIS-DAP and JLINK) take care and also calculate the checksum when verifying NXP LPC devices. So, for example, using an ULINK unit would help.

But the other option is, to update the checksum in the image before flashing. The ElfDWT tool can be used for this. This can be run as user command after the build to automate the process. Flashing the resulting image should not give verify errors.


Last Reviewed: Tuesday, April 10, 2018

Did this article provide the answer you needed?
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.