Keil Logo


Information in this article applies to:

  • ULINK USB-JTAG Adapter
  • ULINK2 USB-JTAG Adapter


I am using the NXP LPC2000 devices and I came across the following statement in the NXP User's Manual:

The reserved ARM interrupt vector location (0x0000 0014) should contain the 2's complement of the check-sum of the remaining interrupt vectors. This causes the checksum of all of the vectors together to be 0.

When I look to the startup code, I can only see a NOP instruction at location 0x14.

Vectors         LDR     PC, Reset_Addr
                LDR     PC, Undef_Addr
                LDR     PC, SWI_Addr
                LDR     PC, PAbt_Addr
                LDR     PC, DAbt_Addr
                NOP                            ; Space for Checksum
                LDR     PC, [PC, #-0x0FF0]     ; Vector from VicVectAddr
                LDR     PC, FIQ_Addr

I am wondering where this checksum is generated in the Keil tools. Is the correct checksum value added automatically?


Yes, the Flash checksum is generated by the ULINK Flash programmer when you download the memory image.

The flash algorithm code contains the following section that calculates this checksum. The algorithms are available in source code in the folder ..\ARM\Flash.

  if (adr == 0) {                              // Check for Interrupt Vectors
    n = *((unsigned long *)(buf + 0x00)) +     // Reset Vector
        *((unsigned long *)(buf + 0x04)) +     // Undefined Instruction Vector
        *((unsigned long *)(buf + 0x08)) +     // Software Interrupt Vector
        *((unsigned long *)(buf + 0x0C)) +     // Prefetch Abort Vector
        *((unsigned long *)(buf + 0x10)) +     // Data Abort Vector
        *((unsigned long *)(buf + 0x18)) +     // IRQ Vector
        *((unsigned long *)(buf + 0x1C));      // FIQ Vector
    *((unsigned long *)(buf + 0x14)) = 0 - n;  // Signature at Reserved Vector


  • NXP LPC2000 Microcontroller User's Manuals -  Flash Memory System and Programming - Criterion for valid user code


Last Reviewed: Friday, June 3, 2011

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.