SPRAD51A December   2023  – April 2024 F29H850TU , F29H859TU-Q1 , TMS320F2800157 , TMS320F280039 , TMS320F280039-Q1 , TMS320F280039C , TMS320F280039C-Q1 , TMS320F28P659DK-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Programming Fundamentals
  6. 3ROM Bootloader and Hex Utility Usage
  7. 4DCAN Flash Kernel
    1. 4.1 Implementation
      1. 4.1.1 Custom Flash Bank and Sector Erase
      2. 4.1.2 Application Load
  8. 5MCAN Flash Kernel
    1. 5.1 Implementation
      1. 5.1.1 Custom Flash Bank and Sector Erase
      2. 5.1.2 Application Load
  9. 6Example Implementation
    1. 6.1 Device Setup
      1. 6.1.1 Flash Kernels
      2. 6.1.2 Hardware
    2. 6.2 Host Application: dcan_flash_programmer
      1. 6.2.1 Overview
      2. 6.2.2 Building and Running dcan_flash_programmer Using Visual Studio
      3. 6.2.3 Running dcan_flash_programmer for F28003x
      4. 6.2.4 Using the Project With DCAN Bootloader
      5. 6.2.5 Using the Project With CCS
    3. 6.3 Host Application: can_flash_programmer [MCAN]
      1. 6.3.1 Overview
      2. 6.3.2 Building and Running can_flash_programmer Using Visual Studio
      3. 6.3.3 Running can_flash_programmer for F28003x
      4. 6.3.4 Using the Project With MCAN Bootloader
      5. 6.3.5 Using the Project With CCS
    4. 6.4 Application Load: CPU2 Image
      1. 6.4.1 Combining Two Images (.txt)
  10. 7Troubleshooting
    1. 7.1 General
    2. 7.2 DCAN Boot
    3. 7.3 MCAN Boot
  11. 8References
  12. 9Revision History

Application Load

This section walks through the entire flow of programming an application into flash using the MCAN boot mode.

Ensure the device is ready for MCAN communications by resetting the device while ensuring the boot mode pins are in the proper state to select MCAN Boot mode. These are the steps that follow:

  1. The device enters the MCAN Boot loader and waits to receive message frames in the RX Message Buffer. Acceptable messages have a MSGID value of 0x1 for boot-loader communication.
  2. The flash kernel is transferred to the device with 64 bytes of data per frame at 1Mbps (nominal bitrate). The host programmer will transmit frames to the device until the kernel has finished download.
  3. The ROM transfers control and the flash kernel begins to execute. There is a small delay in which the kernel must prepare the device for flash programming before it is read to begin communications, and in this time the kernel configures the PLL, flash wait states, and so forth.
    1. The F28P55x kernel will erase the user-designated flash banks/sectors at this point.
    2. The F28P65x and F28003x kernels erase flash at a later point.
  4. The kernel enters MCAN Boot mode and waits to receive message frames in the RX Message Buffer. The bit-rate switching (BRS) value is adjusted within the project and allows the bitrate to be increased to 2Mbps (data bitrate), to allow for a faster download of the application.
  5. The host programmer delays for 5 seconds before sending the application image at 2Mbps and payload of 64 bytes per frame.
  6. At the beginning of the download process, a key, a few reserved fields, and the application entry point are read.
    1. The F28P65x kernel begins to erase the flash at this point. Erasing flash can take a few seconds, so it is important to note that while it looks like the application load may have failed, it is likely that the flash is just being erased.
  7. Once the flash is erased, the application load continues by transferring frames of data into blocks of application code, and programming that into flash 128-bits or 512-bits at a time.
    1. The F28P55x flash kernel programs 512-bits at a time
    2. The F28003x and F28P65x flash kernels program 128-bits at a time
      1. Before programming data, the F28003x kernel checks each flash sector to see if it has been erased . If it is has not been previously erased, the sector is erased and the application data is programmed.
  8. After a block of data is programmed into flash, the kernel continue to receive messages to program the next block of data. This process continues until the entire application has been programmed into flash.

Now that the application is programmed into flash, the flash kernel attempts to run the application by branching to the entry point that was transferred to it at the start of the application load process. A device reset is needed for this.