SPNA245 September   2020 TM4C1290NCPDT , TM4C1290NCPDT , TM4C1290NCZAD , TM4C1290NCZAD , TM4C1292NCPDT , TM4C1292NCPDT , TM4C1292NCZAD , TM4C1292NCZAD , TM4C1294KCPDT , TM4C1294KCPDT , TM4C1294NCPDT , TM4C1294NCPDT , TM4C1294NCZAD , TM4C1294NCZAD , TM4C1297NCZAD , TM4C1297NCZAD , TM4C1299KCZAD , TM4C1299KCZAD , TM4C1299NCZAD , TM4C1299NCZAD , TM4C129CNCPDT , TM4C129CNCPDT , TM4C129CNCZAD , TM4C129CNCZAD , TM4C129DNCPDT , TM4C129DNCPDT , TM4C129DNCZAD , TM4C129DNCZAD , TM4C129EKCPDT , TM4C129EKCPDT , TM4C129ENCPDT , TM4C129ENCPDT , TM4C129ENCZAD , TM4C129ENCZAD , TM4C129LNCZAD , TM4C129LNCZAD , TM4C129XKCZAD , TM4C129XKCZAD , TM4C129XNCZAD , TM4C129XNCZAD

 

  1.   Abstract
  2.   Trademarks
  3. 1Introduction
  4. 2Installation of Edde Flex CAN Booster Pack for TI TIVA C
  5. 3Download and Import the CAN Examples
  6. 4Modified CAN.C for Interrupts
  7. 5Example Projects
    1. 5.1 Internal Loopback With Interrupts (simple_can_loopback)
    2. 5.2 Simple CAN Transmit (simple_can_tx)
    3. 5.3 Simple CAN Receive (simple_can_rx)
    4. 5.4 CAN UART Bridge (can_uart_bridge)
  8. 6CAN Bootloader
    1. 6.1 Bootloader Configuration
    2. 6.2 Boot Demo Program (boot_demo_can)
    3. 6.3 UART-to-CAN Bridge for LM Flash Programmer Support
      1. 6.3.1 SendCANID PC Program
      2. 6.3.2 CCS Demo Program (uart_to_can)
    4. 6.4 Using the CAN Bootloader

Using the CAN Bootloader

Program the object file “uart_to_can\debug\uart_to_can.out” into one EK-TM4C1294XL board on your CAN network. Identify which COM port is assigned to this board. Program the object file “boot_can\debug\boot_can.out” into one or more other EK-TM4C1294XL Launchpads on your CAN network. Code Composer Studio only recognizes one Launchpad at a time, so it may be necessary to connect to each Launchpad individually. Once all of the Launchpads are programmed, the demo can be run without the use of Code Composer Studio.

The Launchpad with “uart_to_can.out” should be connected to the PC so you have access to its serial port. The other Launchpads can be connected to a PC or a wall USB charger for power only.

Open LM Flash Programmer and configure it for using the UART interface at 115200 baud. It should use the same COM port as the one attached to the Launchpad with the “uart_to_can.out” program.

GUID-20200902-CA0I-S86W-BLMT-PRVFSN0XVZT5-low.png Figure 6-1 Configuring LM Flash Programmer

On LM Flash Programmer select the “Program” tab and browse to the “boot_demo_can\ONE\boot_demo_can.bin” file. Set the “Program Address Offset:” to 0x4000. Press the “Program” button.

GUID-20200914-CA0I-HB9V-GHZJ-JLQ74HSMSWQD-low.png Figure 6-2 Programming With LM Flash Programmer

When programming is complete, you will see one blinking LED on the board with the boot loader. This device is now running the application code that was programmed through the CAN bootloader. This application code blinks a single LED, but it also is looking for a specific CAN frame that will cause the CPU to jump back to the CAN bootloader. A CAN frame with arbitration ID of 0x1F028000 and the first data byte equal to 0x01 will cause this unit to return to the CAN bootloader.

Open a command window on the PC and change to the directory with the example projects. In that directory is a PC executable program “SendCANID.exe” and four .bat files. From the command window enter “StopONE COMnn” substituting the number of your COM port for “nn’. You should see a result similar to those below and the LED should stop blinking.

C:\MyWorkspace>StopONE COM16
C:\MyWorkspace>SendCANID COM16 0x1F028000 0x01
Program to select CAN ID for download, Version 1.00
Opened serial port COM16 successfully
Sent ID: 0x1F028000 Data: 0x01
Received: 0xCC
C:\MyWorkspace>

Now that the LaunchPad has been reverted to executing the CAN bootloader, you can use LM FlashProgrammer to change the application code. Try programming “boot_demo_can\TWO\boot_demo_can.bin”.

Using this example application code and bootloader code, a single unit on a CAN bus can be put in CAN bootloader mode and updated. Each device on the CAN bus can be updated one at a time. The can_to_uart code does not support updating multiple devices at the same time. To do that the can_to_uart code and the CAN bootloader would need to be modified to support multiple status responses to each CAN command.

As an additional feature, if the “uart_to_can” program receives from the “SendCANID” program the ID 0xFFFFFFFF and data 0x00, then the “uart_to_can” program will jump to its ROM serial bootloader allowing the “uart_to_can” program to be updated or overwritten.