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
The CAN bootloader asynchronously transfers code from CAN-A to internal memory. The host can be any CAN node. The communication is first done with 11-bit standard identifiers (with a MSGID of 0x1) using two bytes per data frame. The host can download a kernel to reconfigure the CAN if higher data throughput is desired.
The bit timing registers are programmed in such a way that a 100kbps bit rate is achieved with a 20MHz external oscillator, a shown in Table 4-26.
OSCCLK | SYSCLK | Bit Rate |
---|---|---|
20MHz | 10MHz | 100kbps |
The SYSCLKOUT values shown are the reset values with the default PLL setting. The BRP and bit-time values are hard-coded to 10 and 20, respectively.
Mailbox 1 is programmed with a standard MSGID of 0x1 for boot-loader communication. The CAN host must transmit only 2 bytes at a time, LSB first and MSB next. For example, to transmit the word 0x08AA to the device, transmit AA first, followed by 08. The program flow of the CAN bootloader is identical to the SCI bootloader. The data sequence for the CAN bootloader is shown in Table 4-27.
Bytes | Byte 1 of 2 | Byte 2 of 2 | Description | |
---|---|---|---|---|
1 | 2 | AA | 08 | 0x08AA (KeyValue for memory width = 16 bits) |
3 | 4 | 00 | 00 | reserved |
5 | 6 | 00 | 00 | reserved |
7 | 8 | 00 | 00 | reserved |
9 | 10 | 00 | 00 | reserved |
11 | 12 | 00 | 00 | reserved |
13 | 14 | 00 | 00 | reserved |
15 | 16 | 00 | 00 | reserved |
17 | 18 | 00 | 00 | reserved |
19 | 20 | BB | AA | Entry point PC[22:16] |
21 | 22 | DD | CC | Entry point PC[15:0] (PC = 0xAABB CCDD) |
23 | 24 | NN | MM | Block size of the first block of data to load = 0xMMNN words |
25 | 26 | BB | AA | Destination address of first block Addr[31:16] |
27 | 28 | DD | CC | Destination address of first block Addr[15:0] (Addr = 0xAABB CCDD) |
29 | 30 | BB | AA | First word of the first block in the source being loaded = 0xAABB |
... ... ... |
.... Data for this section. ... |
|||
. | BB | AA | Last word of the first block of the source being loaded = 0xAABB | |
. | NN | MM | Block size of the 2nd block to load = 0xMMNN words | |
. | BB | AA | Destination address of second block Addr[31:16] | |
. | DD | CC | Destination address of second block Addr[15:0] | |
. | BB | AA | First word of the second block in the source being loaded | |
. | … | |||
n | n+1 | BB | AA | Last
word of the last block of the source being loaded (More sections if required) |
n+2 | n+3 | 00 | 00 | Block size of 0000h - indicates end of the source program |
The CAN bootloader provides an option to increase the default bit-rate. By default, the CAN bit-timing register (CAN_BTR) is programmed for 100kbps bitrate with a 20MHz external oscillator. If a faster bit-rate is desired, the host can supply certain parameters as part of the bit-stream. These parameters are then used to modify the CANBTR register and hence the bit-rate. CAN_BTR determines the current bit-rate, represented by a 32-bit value. For the generated application hex file on the host side, the 8-bit data-stream has the following sequence of bytes: AA, 08, 00, 00, .. .. .., 00 (16 reserved bytes). The KeyValue is the first two bytes (0x08AA), ordered in LSB-MSB format. Through usage of a host programmer, after the KeyValue has been recognized and the reserved words parsed by the bootloader, the value of the CAN_BTR register can be changed with new (non-zero) bit-timing register values. For example, suppose an application wants to increase the bit-rate to 1Mbps. A value of 0x7AC0 written to CAN_BTR can achieve this (note that a given bit-rate can be achieved with different combinations of TSEG1 and TSEG2 values; 0x7AC0 is just shown as an example). The generated application text file needs to be modified as follows to achieve this: AA, 08, C0, 7A, …, 00 to choose the new bit-rate (100kbps to 1Mbps). Additionally, the host programmer can modify the bit-rate to continue communicating with the boot-loader at the new bitrate.