lpcware

Setting up a LPC32x0 binary for serial boot

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by wellsk on Tue Aug 09 11:08:15 MST 2011
If you want to boot an image on the LPC32x0 from serial FLASH, the image must be setup to load and boot from address 0x0, have a correct serial header word, and the size of the image. Serial images are stored in serial FLASH as follows:
Offset 0: Serial header word (0xDF 0x9B 0x57 -xz13)
Offset 4: Size in bytes, must not be larger than 56KBytes. Example: 0x2000 bytes = 0x00 0x20 0x00 0x00
Offset 8: Boot data with size as defined in offset 4

If you already have a binary, you can use the tool attached to this topic to generate a binary with the correct serial header and size fields. The tool should work on Windows XP, Vista, and Win7 machines. Source code is included in the package.

To use the tool to convert an image for serial boot, use the following procedure:
<code>
c:\nxpmcu\sboot>lpc32x0_sboot_format kickstart_nand_small_block_gnu.bin
LPC32x0 serial boot header generator
Binary input file : kickstart_nand_small_block_gnu.bin
Binary input file size : 12266 bytes
Creating output file : kickstart_nand_small_block_gnu.bin.boot
Inserting serial boot header at offset 0
Inserting serial boot size at offset 4
Shifting boot data to offset 8
Binary output file with serial header : kickstart_nand_small_block_gnu.bin.boot

c:\nxpmcu\sboot>
</code>

The binary file at offset contained the following data:

<code>
06 00 00 EA FE FF FF EA FE FF FF EA FE FF FF EA FE FF FF EA FE FF FF EA FE FF FF EA FE FF FF EA
</code>

After the program was run, the file size is 8 bytes bigger with the serial header and size attached at offset 0:
<code>
DF 9B 57 13 EA 2F 00 00 06 00 00 EA FE FF FF EA FE FF FF EA FE FF FF EA FE FF FF EA FE FF FF EA
</code>

Original Attachment has been moved to: lpc32x0_sboot_format.zip

Outcomes