This Technical Note discusses the "special" vector table checksum that is required by some NXP LPC devices.
NXP LPC devices need a special checksum to be placed at a specific address (in the vector table). IAR Embedded Workbench for ARM will automatically calculate this checksum and place it. It is very important that a custom CRC checksum must not be calculated over this special checksum in the vector table.
When you build you get the error
ielftool error: Checksums have dependencies
The error is issued since both the vector table checksum and the application checksum are calculated by the same ielftool command.
The solution is to exclude the vector table from the calculation of the application checksum, which can be done by setting the start address to the first address that follows the vector table.
Change option "Linker > Checksum > Start address" from 0x0 to 0x40.
(Check the .map file to find the end address of section .intvec)
The checksum of your application have to include the vector table too, but "Solution 1" excludes the vector table.
If you use a post-build command line, the two checksums will be calculated by separate ielftool commands, i.e. avoiding the dependency that caused the ielftool error, and the start address 0x0 can be used.
--verbose "$TARGET_PATH$" "$TARGET_PATH$"
The option "Output Converter > Output > Generate additional output > Output format: binary" is set, but the checksum of the application is not included in the generated binary file.
The reason is that the binary file is generated after linking but before the post-build action, i.e. before the checksum is calculated by the post-build action!
The solution is to let the post-build command line invoke a .bat file that first calculates the checksum and then generates additional output.
See example project IAR Embedded Workbench for ARM - Example (LPC device).zip.
This example project is based on an example called 'Example (1 range, 3 diff. locations)', configuration 'PlaceEndOfROM'. The target is changed to LPC1768 in order to provoke the ielftool error, but the address range over which the checksum is calculated is still the same as in the original example project.
:: calculate application checksum
ielftool --fill 0xFF;0x0-0xfffb --checksum __checksum:2,crc16,0x0;0x0-0xfffb --verbose %OUT% %OUT%
:: generate additional output: hex
ielftool.exe --ihex --verbose %OUT% %HEX%
:: generate additional output: binary
ielftool.exe --bin --verbose %OUT% %BIN%
All product names are trademarks or registered trademarks of their respective owners.