ARM Technical Support Knowledge Articles

VECTOR CHECKSUM FOR NXP LPC2000 DEVICES

Applies to: ULINK USB-JTAG Debugger

Answer


Information in this article applies to:


QUESTION

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?

ANSWER

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
  }

MORE INFORMATION

SEE ALSO

Article last edited on: 2011-06-03 09:22:54

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential