SPRUI33H November 2015 – June 2024 TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1
Table 4-28 and Example4-1 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.
The first 16-bit word in the data stream is known as the key value. The key value is used to indicate to 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 it. If a bootloader does not use these values then they are reserved for future use and the bootloader simply reads the value and then discards it. 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 can be 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 cleans up and exits. Execution then 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 |