SPRAD51A December 2023 – April 2024 F29H850TU , F29H859TU-Q1 , TMS320F2800157 , TMS320F280039 , TMS320F280039-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F28P659DK-Q1
At the beginning of device startup, the device boots and, based on the boot mode, decides if it should execute code already programmed into the Flash memory or load in code using one of the ROM loaders. This application note focuses on the boot execution path when the emulator (CCS) is not connected.
Boot Mode | GPIO24 (default boot mode select pin 1) | GPIO32 (default boot mode select pin 0) |
---|---|---|
Parallel I/O | 0 | 0 |
SCI/Wait boot | 0 | 1 |
CAN | 1 | 0 |
Flash | 1 | 1 |
After the boot ROM readies the device for use, it decides where it should start executing (flash or Boot ROM). In the case of a standalone boot, it does this by examining the state of two GPIOs (as seen in Table 3-1, the default choices are GPIO 24 and 32). In some cases, two values programmed into one time programmable (OTP) memory can be examined. In the implementations described in this application note, both the CAN and MCAN loader are used, so at power up GPIO 32 must be forced low and GPIO 24 must be forced high. If this is the case when the device boots, the CAN loader in ROM begins executing and waits to receive data from the host.
For CAN Boot mode (DCAN), the boot table for GPIO assignments is defined by Table 3-2. Table 3-3 shows the MCAN Boot Options. Note that the boot options for DCAN and MCAN use the same GPIO assignments to select the boot definition value. The common GPIO pairs are GPIO4 and GPIO5, as well as GPIO13 and GPIO12. For more information, read the boot options in the device-specific TRM.
Option | BOOTDEF Value | CANTXA GPIO | CANRXA GPIO |
---|---|---|---|
0 (default) | 0x02 | GPIO4 | GPIO5 |
1 | 0x22 | GPIO32 | GPIO33 |
2 | 0x42 | GPIO2 | GPIO3 |
3 | 0x62 | GPIO13 | GPIO12 |
Option | BOOTDEFx Value | CANTXA GPIO | CANRXA GPIO |
---|---|---|---|
0 | 0x08 | GPIO4 | GPIO5 |
1 | 0x28 | GPIO1 | GPIO0 |
2 | 0x48 | GPIO13 | GPIO12 |
The ROM loader requires data to be presented to it in a specific structure. The structure is common to all ROM loaders and is described in detail in the Bootloader Data Stream Structure section of [6] . You can easily generate your application in this format by using the hex2000 utility included with the TI C2000 compiler. This file format can even be generated as part of the Code Composer Studio build process by adding a post-build step with the following options:
"${CG_TOOL_HEX}" "${BuildArtifactFileName}" -boot -sci8 -a -o "${BuildArtifactFileBaseName}.txt"
Alternatively, you can use the TI hex2000 utility to convert COFF and EABI .out files into the correct boot hex format. To do this, you need to enable the C2000 Hex Utility under Project Properties. The command is below:
hex2000.exe -boot -sci8 -a -o <file.txt> <file.out>
As stated before, ROM loaders can only load code into RAM, which is why they are used to load in flash kernels, which will be described in DCAN Flash Kernel and MCAN Flash Kernel sections.
The flash kernel expects the firmware image to be in the same format, so the command above can be used for the firmware image hex file generation as well.
The MCAN ROM bootloader has three boot options and each option is mapped to different GPIO pins to be used for MCANRX and MCANTX functions. In order to configure the device for MCAN Boot Mode, the OTP of the device needs to be programmed to include MCAN Boot. For more details on how to program the one time programmable (OTP), see the Boot ROM chapter of the TMS320F28003x Real-Time Microcontrollers Technical Reference Manual (TRM).