SPNA241 August   2019 RM41L232 , RM42L432 , RM44L520 , RM44L920 , RM46L430 , RM46L440 , RM46L450 , RM46L830 , RM46L840 , RM46L850 , RM46L852 , RM48L530 , RM48L540 , RM48L730 , RM48L740 , RM48L940 , RM48L950 , RM48L952 , RM57L843 , TMS570LC4357 , TMS570LC4357-EP , TMS570LC4357-SEP , TMS570LS0232 , TMS570LS0332 , TMS570LS0432 , TMS570LS0714 , TMS570LS0714-S , TMS570LS0914 , TMS570LS10106 , TMS570LS10116 , TMS570LS10206 , TMS570LS1114 , TMS570LS1115 , TMS570LS1224 , TMS570LS1225 , TMS570LS1227 , TMS570LS20206 , TMS570LS20206-EP , TMS570LS20216 , TMS570LS20216-EP , TMS570LS2124 , TMS570LS2125 , TMS570LS2134 , TMS570LS2135 , TMS570LS3134 , TMS570LS3135 , TMS570LS3137 , TMS570LS3137-EP

 

  1.   CAN Bus Bootloader for Hercules Microcontrollers
    1.     Trademarks
    2. Introduction
    3. Hardware Requirements
    4. CAN Settings
    5. Software Coding and Compilation
    6. Exception Vector Table
    7. ECC Generation for Bootloader Code
    8. ECC Generation for Application Code
    9. During Bootloader Execution
    10. Bootloader Flow
    11. 10 CAN Bootloader Operation
    12. 11 CAN Bootloader Protocol
    13. 12 Create Application for Use With the Bootloader
    14. 13 Sample Code for PC-Side Application
    15. 14 References

Introduction

The CAN bootloader is a small piece of code that resides at the beginning of flash to act as an application loader. It downloads the application through CAN bus, a reliable operation in automotive and industrial control networks. The bootloader also helps designers update the user application for products already deployed in the field.

This document describes how to work with and customize the Hercules CAN bootloader application. Since full source code is provided, the bootloader can be completely customized.

The bootloader on the target device configures the CAN module in communication with PC host through the CAN bus. The bootloader polls the CAN port for messages. After a message is received, the bootloader attempts to decode the incoming commands for flash programming. After the bootloader has successfully downloaded and programmed the whole application image, the bootloader updates the application header. The bootloader jumps to the starting address of the new application image.

The CAN bootloaders for Hercules devices (TMS570LSx, TMS570LCx, RM4x, and RM5x) have been built and validated using Code Composer Studio™ v9 on the Hercules HDKs. The bootloader host application is developed with Visual C++ 2010. Figure 1 and Table 1 show an overview of the source code provided with the bootloader.

bootloader_process_spna241.gif
Bootloader host application reads the user application.
Bootloader downloads user application to Hercules devices via CAN bus.
Bootloader programs user application into the internal flash of Hercules devices.
Figure 1. Bootloader Process

Table 1. List of Source Code Files Used in CAN Bootloader

bl_main.c The main control loop of the bootloader
bl_dcan.c The functions for transferring data via the CAN port
bl_check.c The code to check if a firmware update is required, or if a firmware update is being requested.
bl_link.cmd The linker script used when the Code Composer Studio compiler is being used to build the bootloader.
bl_flash.c The functions for erasing, programming the Flash, and functions for erase and program check
bl_commands.h The list of commands and return messages supported by the bootloader.
bl_config.h Bootloader configuration file. This contains all of the possible configuration values.
bl_flash.h Prototypes for Flash operations
bl_can.h Prototypes for the CAN transfer functions.
flash_defines.h Flash memory banks and sectors for Hercules microcontrollers
HALCoGen generated files Device initialization