SPRUII0F May 2019 – June 2024 TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S
The following table and associated examples show the structure of the data stream incoming to the bootloader. The basic structure is the same for all the bootloaders and is based on the C54x source data stream generated by the C54x hex utility. The C28x hex utility (hex2000.exe) has been updated to support this structure. The hex2000.exe utility is included with the C2000 code generation tools. All values in the data stream structure are in hex. Refer to The C2000 Hex Utility for more details on using the C28x hex utility to convert a project to this format.
The first 16-bit word in the data stream is known as the key value. The key value is used to tell the bootloader the width of the incoming stream: 8 or 16 bits. Note that not all bootloaders accept both 8- and 16-bit streams. Refer to the detailed information on each loader for the valid data stream width. For an 8-bit data stream, the key value is 0x08AA and for a 16-bit stream the key value is 0x10AA. If a bootloader receives an invalid key value, then the load is aborted.
The next eight words are used to initialize register values or otherwise enhance the bootloader by passing values to the bootloader. If a bootloader does not use these values, then the values are reserved for future use and the bootloader simply reads the value and then discards the value. Currently only the SPI and I2C and parallel bootloaders use these words to initialize registers.
The tenth and eleventh words comprise the 22-bit entry point address. This address is used to initialize the PC after the boot load is complete. This address is most likely the entry point of the program downloaded by the bootloader.
The twelfth word in the data stream is the size of the first data block to be transferred. The size of the block is defined as 8-bit data stream format. For example, to transfer a block of 20 8-bit data values from an 8-bit data stream, the block size is 0x000A to indicate 10 16-bit words.
The next two words indicate to the loader the destination address of the block of data. Following the size and address is the 16-bit words that makeup that block of data.
This pattern of block size/destination address repeats for each block of data to be transferred. Once all the blocks have been transferred, a block size of 0x0000 signals to the loader that the transfer is complete. At this point, the loader returns the entry point address to the calling routine that exits. Execution continues at the entry point address as determined by the input data stream contents.
Byte | Contents | ||
---|---|---|---|
LSB (First Byte of 2) | MSB (Second Byte of 2) | ||
1 | 2 | LSB: AA (KeyValue for memory width = 8 bits) | MSB: 08h (KeyValue for memory width = 8 bits) |
3 | 4 | LSB: Register initialization value or reserved | MSB: Register initialization value or reserved |
5 | 6 | LSB: Register initialization value or reserved | MSB: Register initialization value or reserved |
7 | 8 | LSB: Register initialization value or reserved | MSB: Register initialization value or reserved |
... ... |
... ... |
... ... |
... ... |
17 | 18 | LSB: Register initialization value or reserved | MSB: Register initialization value or reserved |
19 | 20 | LSB: Upper half of Entry point PC[23:16] | MSB: Upper half of entry point PC[31:24] (Always 0x00) |
21 | 22 | LSB: Lower half of Entry point PC[7:0] | MSB: Lower half of Entry point PC[15:8] |
23 | 24 | LSB: Block size in words of the first block to load. If the block size is 0, this indicates the end of the source program; otherwise, another block follows. For example, a block size of 0x000A indicates 10 words or 20 bytes in the block. | MSB: block size |
25 | 26 | LSB: MSW destination address, first block Addr[23:16] | MSB: MSW destination address, first block Addr[31:24] |
27 | 28 | LSB: LSW destination address, first block Addr[7:0] | MSB: LSW destination address, first block Addr[15:8] |
29 | 30 | LSB: First word of the first block being loaded | MSB: First word of the first block being loaded |
... ... |
... ... |
... ... |
... ... |
. | . | LSB: Last word of the first block to load | MSB: Last word of the first block to load |
. | . | LSB: Block size of the second block | MSB: Block size of the second block |
. | . | LSB: MSW destination address, second block Addr[23:16] | MSB: MSW destination address, second block Addr[31:24] |
. | . | LSB: LSW destination address, second block Addr[7:0] | MSB: LSW destination address, second block Addr[15:8] |
. | . | LSB: First word of the second block being loaded | MSB: First word of the second block being loaded |
... ... |
... ... |
... ... |
... ... |
. | . | LSB: Last word of the second block | MSB: Last word of the second block |
. | . | LSB: Block size of the last block | MSB: Block size of the last block |
. | . | LSB: MSW of destination address of last block Addr[23:16] | MSB: MSW destination address, last block Addr[31:24] |
. | . | LSB: LSW destination address, last block Addr[7:0] | MSB: LSW destination address, last block Addr[15:8] |
. | . | LSB: First word of the last block being loaded | MSB: First word of the last block being loaded |
... ... |
... ... |
... ... |
... ... |
. | . | LSB: Last word of the last block | MSB: Last word of the last block |
n | n+1 | LSB: 00h | MSB: 00h - indicates the end of the source |