Author Topic: Modification of Valid User Code at address 0x1C  (Read 4473 times)

defib

  • Jr. Member
  • **
  • Posts: 1
    • View Profile
Modification of Valid User Code at address 0x1C
« on: September 10, 2012, 09:38:14 am »
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

  • ESAcademy Staff
  • Sr. Member
  • *****
  • Posts: 2190
    • View Profile
    • Embedded Systems Academy, Inc.
    • Email
Re: Modification of Valid User Code at address 0x1C
« Reply #1 on: September 11, 2012, 12:51:31 am »
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
« Last Edit: September 11, 2012, 12:53:32 am by Andy Ayre »
Embedded Systems Academy, Inc.
support at esacademy dot com