
This directory contains a utility that converts binary application images
into images that the NET+OS bootloader can process.  It does this by adding
a header at the beginning of the image and attaching a checksum value at 
the end. The command line for this utility is:

    imagehdr <type> <size-config-file> <control-config-file> <input-file> <output-file> [<custom-header-file>]
    
    Where   <type> - BOOT  = boot header (normal image).
		             UBOOT = uboot header (UBoot).
		             SPI   = SPI boot header.
		             SPI9215 = SPI boot header for 9215/9210 processors.

            <size-config-file> - Linker file that specifies addresses and 
                                 maximum size for setting the header.
		                         Not used for SPI boot header (Specify NULL).
            <control-config-file> - Control file that contains 
		                            BSP_APP_IMAGE_WITH_COMPRESSION,
		                            BSP_APP_IMAGE_WITH_CRC_CHECK, and/or
		                            BSP_FAST_BOOT_OPTION for image header.
		                          - Enable BSP_APP_IMAGE_WITH_COMPRESSION to
                                    generate compressed image.
                                  - Enable BSP_APP_IMAGE_WITH_CRC_CHECK to
                                    include CRC. CRC will be verified during
                                    startup.
                                  - Enable BSP_FAST_BOOT_OPTION to optimize
                                    boot speed.
		                          - May use NULL for non-compressed image
		                            and bypass CRC check.
		                          - For SPI header, specify init_setting.h
		                            header file contains information for SPI.

            Note: when BSP_FAST_BOOT_OPTION is enabled, BSP_APP_IMAGE_WITH_COMPRESSION
		          and BSP_APP_IMAGE_WITH_CRC_CHECK are ignored. 

            <input-file> - Image file that will be added with header info. This
		                   should be a non-compressed image (compressed image will
		                   be generated and used when BSP_APP_IMAGE_WITH_COMPRESSION
		                   is enabled in <control-config-file>.
            <output-file> - Name of file that will be generated for <input-file>
		                    with header info.
		                    A compressed image will be generated when 
		                    BSP_APP_IMAGE_WITH_COMPRESSION is enabled.
            <board-type> - board platform name (not use for SPI boot header).
            <custom-header-file> - optional customize header to be added
		                           to the output file (not use for SPI boot header).

This application can be built with Visual C++.

To successfuilly build this application, follow these steps:

1. Open a DOS window, and set the directory to \netos\netos\src\utilities\imagehdr.  For instance:

        C:> cd \netos\netos\src\utilities\imagehdr

2. Execute the copytolocal batch file:

        C:\netos\netos\src\utilities\imagehdr>copytolocal

3. In Visual Studio, open the workspace C:\netos\netos\src\utilities\imagehdr.dsw
4. Set the Active Configuration to Release
5. Build imagehdr.exe (F7)

This application can also be built from DOS Command Window.

Type the following commands:

nmake /f "imagehdr.mak" CFG="imagehdr - Win32 Release" clean
nmake /f "imagehdr.mak" CFG="imagehdr - Win32 Release"


This will now replace the imagehdr.exe in the \netos\netos\bin directory.


    


