Datasheet

I2C Bootloader
Document Number: 001-13258 Rev. *J Page 7 of 39
Generate Checksum – After your project builds correctly, you can use the bootloader tools to create and
autovalidate checksums. When the bootloader tools selection screen is accessed, the project code is
generated and a complete compile of the entire project is executed. Next, a checksum calculation is
performed on the resulting hex file, which is compared to a checksum stored by the user module. If the
checksums do not match, a message is displayed. You can recalculate and store a new checksum if you
want. If build or compile errors occur in the automated generate and build invoked by the Bootloader Tools
and no hex file is successfully created, an error is reported but no error debug information is displayed in
the build dialog of PSoC Designer. Error reporting is suppressed when the generate and build is invoked
from the automation interface. To debug build errors, it is necessary to use the conventional build and
generate process external to the bootloader tools menu.
Generate dld file – This tool item derives a download file from the hex project output file. This file contains
only the hex blocks that are reprogrammed by the bootloader including the checksum block. The Host
Demonstration application is capable of reading this file and downloading it to a working project
incorporating a bootloader. This download file can be deployed to a field application to upgrade a PSoC
device.
The dld and txt download files are generated by the BootLdrI2C User Module tool and listed in “Output
Files” in Workspace Explorer.
Checksum Semiautomatic Generation
After your project is built and compiled without errors, the application checksum must be generated. The
application checksum is created using one of the utilities accessed by right-clicking on the BootLdrI2C
User Module icon in the Device Editor view and selecting Bootloader Tools. An application checksum
(previously calculated or default) is stored as a hidden user module parameter. When the Bootloader Tools
menu page is invoked, any previous checksum is validated against the one calculated on the current
output\<prj_name>.hex file. Necessarily the checksum cannot be generated before a successful compile.
After a checksum is created, it must be integrated into the compiled files. This requires a second compile.
Special Files Given
You can access several important files by opening the Bootloader Tools menu and selecting Get Files. A
device specific boot.tpl file is placed in the main project directory along with a file called custom.lkp
(ImageCraft), HTLinkOpts.lkp (Hi Tech) and a predefined flashsecurity.txt file. The original versions of
these files are placed in the project backup directory. The purpose of each file is briefly described:
Boot.tpl. – This file contains a relocatable and nonrelocatable definition of interrupt vector tables and
device specific boot setup, which is specified in a relocatable area of the ROM instead of the fixed location
specified in the standard boot.tpl file.
Custom.lkp – When source generation takes place, the custom.lkp file is populated with autogenerated
ROM areas for major code blocks as defined in the user module parameters. Do not modify the following
code blocks in the custom.lkp file:
-bSSCParmBlk: Contains specified critical RAM used during flash operations.
-bBootloader
-bBLChecksum
-bUserAPP: Changes to any of the last three lines result in an error dialog indicating the inability of the
project to detect the correct custom.lkp file.
During code generation, each of the last three lines of the custom.lkp file are rewritten under control of the
code generation software. Changes made within or below the last three lines either cause an error or are
simply lost. You can make changes to the rest of the custom.lkp file. To debug the memory allocation of
the project, comment out all three lines mentioned earlier by inserting a semicolon in the first space. This