8 years, 11 months ago.

Why and how should we "modify vector checksum value"?

When you run make on an exported (GCC ARM Embedded) "blinky" you get a message in the compile output saying

*****
***** You must modify vector checksum value in *.bin and *.hex files.
*****

/opt/gcc-arm/bin/arm-none-eabi-size GCC_Eclipse_Debug.elf
   text	   data	    bss	    dec	    hex	filename
  27512	    180	    764	  28456	   6f28	GCC_Eclipse_Debug.elf

It is not clear why or how to modify these values. Nor is a quick search turning anything up.

Question relating to:

This is also reported by OpenOCD when you run GDB for debugging....

Info : JTAG tap: lpc17xx.cpu tap/device found: 0x4ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x4)
target state: halted
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x1fff0080 msp: 0x10001ffc, semihosting
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (1546). Workaround: increase "set remotetimeout" in GDB
Warn : Verification will fail since checksum in image (0x00000000) to be written to flash is different from calculated vector checksum (0xefff2f8e).
Warn : To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
Warn : keep_alive() was not invoked in the 1000ms timelimit. GDB alive packet not sent! (57899). Workaround: increase "set remotetimeout" in GDB
posted by David Godfrey 11 Mar 2015

1 Answer

8 years, 11 months ago.

This one explains it, http://bgamari.github.io/posts/2012-03-28-jtag-over-buspirate.html, there's flashing new image section.

Not certain though, if this is still valid. I have never edit that vector checksum for the mbed board

posted by Martin Kojtal 11 Mar 2015

The checksum is usually inserted by the programmer/flash device. This is the case for the Segger JFlash and for the NXP Flashmagic utility. I guess that the mbed interface chip has a similar function. See here

posted by Wim Huiskamp 11 Mar 2015

Thanks wim. That's why I havent done it manually :)

posted by Martin Kojtal 11 Mar 2015

Thanks, much as I thought. It's just another piece of the puzzle for using Eclipse and OpenOCD.

Martin,keeping in mind that I hope to sort out GCC export with eclipse project files, if we were to provide a tool that an eclipse project file could call (ie: autogenerated project file included in the export) do you think it would be acceptable to provide a linux binary, and a windows binary as part of the export with the makefile calling whichever is appropriate? MAC OS may be possible as well, but I don't know for sure as I have no experience with mac's.

I just did a test compile of the code you linked to with linux 64bit gcc (no arguments) and got a 6280 byte binary. There are a few other options I can think of easily,

  • use some makefile magic to dump the needed 306 bytes of source to a temp file and compile before use. would require gcc to be available.
  • require user to download the tool and place it in the path. warn if it's not available
  • reimplement as bash/perl/python/etc this would work well on most linux systems, and likely OSX, but could be a pain for windows systems.
posted by David Godfrey 11 Mar 2015