Keil Logo

ARM: LPC18xx/43xx On-chip Flash Loader Vector Checksum Calculation

Information in this knowledgebase article applies to:

  • LPC18xx/43xx On-chip Flash Loader


When I load an example to the internal flash on the LPC18xx/43xx and correctly set the boot pins, the program still won't run.

What could be wrong?


The most likely reason this happens is that the application does not fulfill the criteria for Valid User Code. Unlike the on-chip flash loaders for other LPC devices, the flash loader for LPC18xx/43xx on-chip flash does not calculate the NXP specific vector table checksum. So the on-chip boot loader will not detect valid user code and does not boot from it.

The reason for this different behavior is that LPC18xx/43xx can boot from different flash banks. It is up to the user to place the vector table in flash bank A or B. The generic flash loader must NOT modify the flash bank which does not contain the vector table.


Add the checksum to the output file with a user command that runs automatically after the build. MDK-ARM also supplies the suitable command line tool for this purpose.

In Options for Target — User — Run User Programs After Build/Rebuild add:


If your application starts from bank A.
Or add:


if your application starts from bank B.
So the correct vector checksum will be added to the output file and the NXP on-chip boot loader will recognize it as valid user code.

Note for creating a HEX file with valid checksum:
Selecting the option Create HEX file in the µVision dialog Options for Target - Output will generate a HEX file based on the original AXF file without a valid checksum. Deselect this option and add the invocation of fromelf.exe in a second User - Run User - After Build/Rebuild command just below the invocation of ELFDWT.EXE:

$K\ARM\ARMCC\BIN\fromelf.exe --i32combined -o !H  !L

Then, fromelf.exe reads the AXF file with valid checksum and converts it to a HEX file.

Note: - ModernULINK Pro drivers handle the placing of the checksum value, so calling fromelf.exe is no longer required.



Last Reviewed: Thursday, February 15, 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.