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

Overview

The host is responsible for sending the DCAN kernel image and flash (firmware) image to the MCU. The PEAK PCAN-USB Pro FD CAN bus Analyzer is used as the host. The flash programmer project is built and run on Visual Studio 2019. The host programmer uses the PCAN_Basic API from PEAK. The PCAN_Basic API can be used to send and receive CAN frames on the CAN analyzer.

Note: The PEAK PCAN-USB Pro FD CAN bus Analyzer is backwards compatible to receive both classical CAN frames as well as CAN-FD frames.

On the F28003x device, the clock to the MCAN module is switched to the external clock source by the Boot ROM. The external clock is 20MHz in the LaunchPad and the ControlCard. The Boot ROM configures the nominal bit rate to be 100Kbps. The host CAN programmer configures the PEAK CAN analyzer to have the same clock and nominal bit rate value.

The host initializes the analyzer for CAN usage, and sends the kernel over in 2-byte increments, and then sends over the image in 8-byte increments, with a delay of 10 ms between each frame to give the Flash API time to program the data it is receiving into Flash. Once the firmware image has been written, the host CAN programmer exits.

The command line PC utility is a programming solution that can easily be incorporated into scripting environments for applications like production line programming. It was written using Microsoft Visual Studio® in C++. The project and its source can be found in C2000Ware (C2000Ware_x_xx_xx_xx > utilities > flash_programmers > dcan_flash_programmer).

To use this tool to program the C2000 device, ensure that the target board has been reset and is currently in the CAN boot mode and connected to the PC COM port. The host programmer will take in kernel and application files as inputs on the command line. There are also options for quiet or verbose output, and an option to wait on exit before closing the CAN flash programmer application. The command line usage of the tool is described below:

dcan_flash_programmer.exe –d <device> -k <kernel file> -a <app file> [-q] [-w] [-v]
-d <device> - The name of the device to connect and load to: F28003x
-k <file> - The file name for the CPU1 flash kernel. This file must be in the ASCII boot format.
-a <file> - The application file name to download or verify to CPU1. This file must be in the ASCII SCI boot format.
-? Or -h - Show help.
-q - Quiet mode. Disable output to stdout.
-w - Wait for a key press before exiting.
-v - Enable verbose output.
Note: Both the flash kernel and flash application MUST be in the SCI8 boot format. The CAN/MCAN ROM loaders follow the same 8-bit channel boot format as the SCI ROM loader, which uses -sci8 format option.