Modification of Valid User Code at address 0x1C

Started by defib, September 10, 2012, 09:38:14 AM

Previous topic - Next topic

defib

I'm developping and debugging my LPC1754 board usually via JTAG and the IDE CrossStudio from Rowley.
I implemented my own flashtest with a checksum over the whole used flash memory.
When flashing and debugging with JTAG the flashtest works.
However, when i tried to update the firmware with the on-chip bootloader and Flash Magic, the checksum algorithm always failed.
I discovered, that the 4 bytes "Valid User Code" at 0x1C are different, when i read back and compare the memory content:
When flashed via JTAG, there is always 0x00000000 - when flashed via Bootloader/FlashMagic there is a non-zero entry.

Is it possible to disable in Flash Magic this image modification?
Why does the uC starts at all, when there is a "Valid User Code" of 0x00000000 written via JTAG  ???


Andy Ayre

#1
It's not possible to disable it because the checksum is required to execute the firmware, so there is no point programming and not using the checksum.

My suggestion is to modify your checksum routine to skip the interrupt vector area 0x00 - 0x1F. If your firmware executes in the first place then the device has already checksummed and verified the interrupt vectors for you so you don't need to do that part.

Execution via JTAG probably bypasses the checksum. However I would expect that if you programmed via JTAG and then reset your board it wouldn't execute.

Andy
Embedded Systems Academy, Inc.
support at esacademy dot com