Vector Calculation?

Started by Mike Tyler, January 21, 2010, 05:34:28 PM

Previous topic - Next topic

Mike Tyler

Hi Andy

A co-worker of mine (Rich Soennichsen) suggested I ask you this question:

Ive veen using the LPC2000 flash utility for years in a build process, to calculate the vectors of a .HEX file that Keil uVision generated.

Ive recently lost the version of the LPC2000 flash utility I was using, so I tried to download it again, to resume development. However, the latest version that NXP has on their website (2.2.3) has a bug that prevents me from selecting the device type I am using (2138) - and the older version 2.2.0 doesnt list the 2138

SO, Rich suggested I try Flash Magic.

However, I havent been able to find any way to use Flash Magic to load a .Hex file, calculate the vectors like I did with the LPC2000 utility, and resave the file. Flash Magic always seems to want to interact with a device. If I open the Hex file,and try to re-save it, it tries to read from a nonexistent device.

Does Flash Magic even have the capability to calculate these vectors and re-save a .HEX file? If not, do you know where I might find the LPC2000 version 2.2.1 - it might be the only one that allows this for the 2138.

Ive been banging my head against the wall all day on this.

Andy Ayre

No, Flash Magic can't do that. It assumes the interrupt vectors have been already generated by a compiler and placed in the hex file. Can you elaborate more on what you mean by calculating the vectors?

I'm not aware of where you can download specific versions of the old tool. However wouldn't selecting a similar device work?

Say hi to Rich for me.

Embedded Systems Academy, Inc.
support at esacademy dot com

Mike Tyler


Here is a screenshot of the Flash Buffer manipulating screen for the LPC2000 flash utility:

I dont actually have a device present. I compile my code with the Keil uVision3 compiler, then take that .HEX file, load it with the LPC flash utility, click "Vector Calc", then resave the file.

From talking to Richard (who taught me this step) this calculates some sort of vector checksum and stores it at address 0x0014. I do see that 4 bytes of the file change when I do this.

I then resave the file.

At that point, I can use a hex2bin utility to create a .bin file that I can load into a another device.

If I do not do this vector calculation step, the code in the .BIN file does not run - the arm7 will hang.

I admit I am not fully aware of all the details of why this is necessary, but it is critical to the process we have in releasing builds.

With the LPC2000 version 2.2.3, the combo box used to select a device does not allow you to select the device type (which you need to do before you can load a .hex file) - until you actually connect a physical device and click "Get device IDs"

At the moment I dont even have a physical device, so it is causing a headache in trying to generate a valid .bin file.

Since NXP retired the lpc flash utility and replaced it with Flash Magic, I was hoping that Flash Magic had the same ability to do this.

Andy Ayre

Ah, I understand now. Flash Magic generates and programs this checksum automatically whenever it programs a hex file. So as long as you use Flash Magic then you don't need to worry about this.

Otherwise I would say that whatever application you are using to program devices should automatically generate the checksum for you. You might want to contact the author of that application.

Flash Magic doesn't have the concept of buffer editing.

To learn more about the interrupt vector checksum see the chapter in the NXP user manual for the LPC2xxx device regarding Flash Memory.

The only other option I have is for us to write a small custom command-line program for you that takes a hex file and generates a binary file with the checksum added. Please contact support @ esacademy dot com if that might be interesting.

Embedded Systems Academy, Inc.
support at esacademy dot com