UART Bootloader for Hercules TMS570LS04x MCU

Similar documents
Wolverine - based microcontrollers. Slashing all MCU power consumption in half

Stacking the REF50xx for High-Voltage References

Protecting the TPS25810 from High Voltage DFPs

HV Solar MPPT DC-DC GUI Overview. Getting Started Guide

DS25BR204 Evaluation Kit

User s Guide for Sonic MDIO Software

4-Level Strap Device Configuration

UCD3138 Responding to Multiple PMBus Slave Addresses

Passing CISPR25-Radiated Emissions Using TPS54160-Q1

WL1271 ini File Description and Parameters User's Guide

SN54LS169B, SN54S169 SN74LS169B, SN74S169 SYNCHRONOUS 4-BIT UP/DOWN BINARY COUNTERS

AN-2245 MSP430 Interface to DAC161P997 Code Library

Design Considerations for Avoiding Timing Errors during High-Speed ADC, High-Speed ADC, LVDS Data Interface with FPGA

System-on-Chip Battery Board User s Guide

AC Induction Motor (ACIM) Control Board

2. With the Evaluation Kit DVD, click the Tools button and then click the Code Composer Studio logo to start the setup program.

The examples in this application report require the Flash API Modules (SPRC236) within the "Tools & Software" folder.

Bootstrap Loader (BSL) Scripter User s Guide

XIO1100 NAND-Tree Test

DSP/BIOS Link. Platform Guide Published on 20 th JUNE Copyright 2009 Texas Instruments Incorporated.

AN-2254 MSP430 Interface to LMP91200 Code Library

DRV8833 Evaluation Module. User's Guide

ABSTRACT. Table of Contents

Application Report. 1 System Requirements. 2 Using the DM643x Pin Multiplexing Utility. Bernard Thompson...

The photograph below shows the PMP9730 Rev E prototype assembly. This circuit was built on a PMP9730 Rev D PCB.

IndoTraq Development Kit 1: Command Reference

TLK10081 EVM Quick Start Guide Texas Instruments Communications Interface Products

TPD3S014-Q1 Evaluation Module

TMS470R1x External Clock Prescale (ECP) Reference Guide

This document describes the features of the GUI program used to control Power Line Modem with E-Meter Platform.

Power over Ethernet Consortium Interoperability Test Report

1 Photo. 7/15/2014 PMP10283 Rev A Test Results

Hands-On: Implementing an RF link with MSP430 and CC1100

AN-2062 LM3549 Evaluation Kit

Adaptive (Dynamic) Voltage (Frequency) Scaling Motivation and

18-Line SCSI Terminator (Reverse Disconnect) UCC5617 FEATURES DESCRIPTION BLOCK DIAGRAM

TPL5000EVM User's Guide

ez430-rf2480 Sensor Monitor SWRU Low-Power RF

Technical Documents. SBAS630D OCTOBER 2013 REVISED MAY 2016 AFE Channel, Analog Front-End for Digital X-Ray, Flat-Panel Detectors.

HSKT TM Technology Specifications

Application Note AN045

TPS63020EVM-487. User's Guide. 1 Introduction. 1.1 Background. 1.2 Performance Specification

Application Report. 1 Introduction. MSP430 Applications. Keith Quiring... ABSTRACT

Technical Documents. CC1310 Simplelink Ultra-Low Power Sub-1 GHz Wireless MCU

TCI6616/C6670/TCI6608/C6678 Device Simulator EMAC Model I/O user-guide

Table 1. Proper Termination of Unused (Port) Pins in a Single-Port PSE System

Test Report PMP Test Data For PMP /20/2015

description VCC 1PRE 1OC 1D1 1C 1Q1 1Q2 1Q3 1Q4 2Q1 2Q2 2Q3 2Q4 2C 2PRE 1D2 1D3 1D4 2D1 2D2 2D3 2D4 2OC GND 1PRE 1OC 1Q1 1D1 1Q2 1Q3 1Q4 1D2 1D3 1D4

PRODUCT DATASHEET. Features. IPNetCam Reference Design on DM365 Product Release 1.5.0, Nov 2009

Ethernet-Enabled Intelligent Display Modules (IDMs)

Clocking Design Guidelines: Unused Pins

TMS320C6000 DSP Interrupt Selector Reference Guide

The photographs below show the top and bottom view of the PMP11282Rev A board, which is built on PMP11064 Rev B PCB. Top Side

Application Report. 1 Hardware Description. John Fahrenbruch... MSP430 Applications

Bluetooth Low Energy CC2540 Mini Development Kit User s Guide

TMS320C6414T/15T/16T Power Consumption Summary

DaVinci System Optimization

FPC401 Quad Port Controller

TIDA V Stepper Motor Controller with Integrated Current Sense Reference Design

TIDA Test Report

TMS320C6000 DSP 32-Bit Timer Reference Guide

FUNCTION TABLE INPUTS OUTPUT OE1 OE2 A Y L L L L L L H H H X X Z X H X Z POST OFFICE BOX DALLAS, TEXAS 75265

Using Endianess Conversion in the OMAP5910 Device

Systems ATE report. All output measurements are taken with 1uF and a 0.1uF MLCC across the DUT output.

Data Concentrator System Solutions

PCIxx12 Single Socket CardBus Controller with Integrated 1394a-2000 OHCI Two-Port PHY/Link-Layer Controller

Micro-Module Integrated Bluetooth 1.2 Baseband Controller and Radio

This section contains background information for the TPS61085EVM evaluation module.

Stereo Dac Motherboard application information

TMS320C620x/C670x DSP Boot Modes and Configuration Reference Guide

TIDA Test Report

TPS62290EVM-279. User's Guide SLVU217 July 2007

Power Line Modem with E-Meter Platform Quick Start Guide

MSP430F20xx Device Erratasheet

Single Cell Battery Power Solution

Programming With the MSP430AFE2xx Family and the MSP430i20xx Family

Interfacing TPS65381 With Hercules Microcontrollers

Quad-Channel TEC Controller Getting Started Guide. Contents. Introduction. Contents of Evaluation Kit

Interfacing the ADS8320/ADS8325 to The TMS320C6711 DSP

TMS320C64x DSP Peripheral Component Interconnect (PCI) Performance

TMS320C672x DSP Software-Programmable Phase-Locked Loop (PLL) Controller. Reference Guide

PACKAGE OPTION ADDENDUM

TMS320C6000 DSP General-Purpose Input/Output (GPIO) Reference Guide

SN5476, SN54LS76A SN7476, SN74LS76A DUAL J-K FLIP-FLOPS WITH PRESET AND CLEAR

Using FlashRunner TM FR03TXI0 for Standalone Programming of UCD3020/UCD3028/UCD3040 & UCD3138 Digital Power Controllers

Using the TMS320C5509 USB Bootloader

TMS470R1VF334E TMS470 Microcontrollers Silicon Errata

The EVM kit includes the ISO5500 data sheet. Figure 1 shows the device pinout and the functional block diagram.

SN65DSI86 SW Examples

Configuring Code Composer Studio for OMAP Debugging

External Programming of the TMS320C64x EDMA for Low Overhead Data Transfers

PMP11140 TPS40400 / CSD85301Q2 Test Report 12V to 1.8V 3A / 4A Texas Instruments

TIDA DS125BR820 40GbE/10GbE QSFP Reference Design User s Guide

Application Report. Low-Power Wireless. Shreharsha Rao... ABSTRACT

SN64BCT757 OCTAL BUFFER/DRIVER WITH OPEN-COLLECTOR OUTPUTS

C2000 Concerto Microcontrollers

LM9022 LM9022 Vacuum Fluorescent Display Filament Driver

Application Report. 1 Overview. Marc Sousa... Power Supply ABSTRACT

Calibration Routines and Register Value Generation for the ADS1216, ADS1217 and ADS1218

Techniques for Profiling on ROM-Based Applications

Transcription:

Application Report Quingjun Wang ABSTRACT This application report describes how to communicate with the Hercules UART bootloader. The UART bootloader is a small piece of code that can be programmed at the beginning of Flash to act as an application loader as well as an update mechanism for applications running on a Hercules Cortex -R4 based TMS570LS04x microcontroller. Project collateral and source code discussed in this application report can be downloaded from the following URL: http://www.ti.com/lit/zip/spna191. Contents 1 Introduction... 1 2 Software Coding and Compilation... 3 3 On Reset... 4 4 During Bootloader Execution... 4 5 MCU Initialization during Bootloader Execution... 4 6 The Protocol Used in UART Bootloader... 4 7 UART Bootloader Operation... 6 8 HyperTerminal Configuration... 9 9 References... 9 List of Figures 1 UART Bootloader Flowchart... 5 2 The UART Bootloader is Loaded Through the JTAG port... 6 3 UART Bootloader Main Menu... 7 4 User Application Code is Loaded Through the UART Bootloader... 7 5 UART Bootloader Jumps to Application Code... 8 6 COM Port Properties... 9 List of Tables 1 List of Source Code Files Used in SPI Bootloader... 3 2 Vector Table in CAN Bootloader... 4 1 Introduction An important requirement for most Flash memory-based systems is the ability to update firmware when installed in the end product. This ability is referred to as in-application programming (IAP). The UART bootloader provides a means of writing, reading, and erasing a predefined section of the program Flash memory that typically holds the user application code. Hercules, Code Composer Studio are trademarks of Texas Instruments. Cortex is a trademark of ARM Limited. ARM is a registered trademark of ARM Limited. All other trademarks are the property of their respective owners. 1

Introduction www.ti.com This document describes how to work with and customize the Hercules UART bootloader application. The bootloader is provided as source code which allows any part of the bootloader to be completely customized. The bootloader has been built and validated using Code Composer Studio v5 on the TMS570LS04x Hercules Development HDK. 2

www.ti.com Software Coding and Compilation Table 1 shows an overview of the organization of the source code provided with the bootloader. Table 1. List of Source Code Files Used in SPI Bootloader sys_startup.c bl_check.c bl_check.h bl_commands.h bl_config.h bl_flash.c bl_flash.h bl_link.cmd bl_main.c bl_packet.c bl_packet.h bl_uart.h bl_uart.c bl_vimram.c hw_gio.c hw_gio.h hw_het.c hw_het.h hw_interrupt_handler.c hw_pinmux.c hw_pinmux.h hw_sci.c hw_sci.h hw_system.c bl_ymodem.c bl_ymodem.h startup_eabi.c sys_intvecs.asm sys_svc.asm The start-up code used when TI s Code Composer Studio compiler is being used to build the bootloader. The code to check if a firmware update is required, or if a firmware update is being requested. Prototypes for the update check code. The list of commands and return messages supported by the bootloader. Bootloader configuration file. This contains all of the possible configuration values. The functions for erasing, programming the Flash, and functions for erase and program check Prototypes for Flash operations The linker script used when the Code Composer Studio compiler is being used to build the bootloader. The main control loop of the bootloader. The functions for handling the packet processing of commands and responses. Prototypes for the packet handling functions. Prototypes for the UART0 transfer functions. The functions for transferring data via the COM0 port. VIM RAM table definition and initialization Low-level GIO driver Prototypes for low-level gio driver Low-level NHET driver Prototypes for low-level NHET driver Define the INT handlers Function for define the pinmux Prototypes for pinmux functions Low-level SCI driver Prototypes for low-level SCI driver Initialize system registers and PLL Function for define the ymodem protocol Prototype define the variables and functions Global variables initialization Interrupt vectors Software INT routines 2 Software Coding and Compilation The bootloader code is implemented in C, ARM Cortex-R4F assembly coding is used only when absolutely necessary. The IDE is TI Code Composer Studio v5.4. The bootloader is compiled in the 32-BIT ARM mode. The bootloader is compiled and linked with the TI TMS470 code generation tools V 5.1. 3

On Reset www.ti.com 3 On Reset On reset, the MCU enters in supervisor mode and starts executing the bootloader. The interrupt vectors are setup as shown in Table 2. Offset Vector Action Table 2. Vector Table in CAN Bootloader 0x00 Reset Vector Branch to entry point of bootloader (c_int00 ) 0x04 Undefined Instruction Interrupt Branch to application vector table 0x08 Software Interrupt Branch to application vector table 0x0C Abort (Prefetch) Interrupt Branch to application vector table 0x10 Abort (Data) Interrupt Branch to application vector table 0x14 Reserved Endless loop (branch to itself) 0x18 IRQ Interrupt Branch to VIM 0x1C FIQ Interrupt Branch to VIM 4 During Bootloader Execution During bootloader execution: MCU operates in supervisor mode MCU Clock is reconfigured and is maintained throughout the bootloader execution. Clock Source: OSCIN = 16 MHz System clock: HCLK = 80 MHz Peripheral clock: VCLK = 40 MHz No interrupts are used Fix point is used throughout the bootloader execution F021 API V2.00.01 executes in RAM The SCI is configured as 115200, 8-N-1 5 MCU Initialization during Bootloader Execution Operating Mode: supervisor mode HCLK Frequency: OSCIN x 120 / 12 VCLK Frequency: VCLK = HCLK / 2 Peripheral Control: peripherals enabled SCI Setup: The SCI/LIN is setup for SCI communication. The setup is 115200 8-N-1. MCU do self-test, PBIST, parity check at startup 6 The Protocol Used in UART Bootloader The bootloader is based on Ymodem protocol. The Ymodem protocol sends data in 1024-byte blocks. Error detection is applied to data blocks transmitted to the TMS570LS04x internal RAM. This is done through a comparison between the transmitted and received data. Blocks received unsuccessfully are acknowledged with a negative acknowledgment (NAK). For more details about the Ymodem protocol, see the existing literature. 4

www.ti.com The Protocol Used in UART Bootloader START Init Device Pushbutton Is pressed? Valid Flag? Initialize MCU UART Display the main menu Switch to user application Download/Upload Or Execute the application code #1 #2 #3 #4 #5 Receive a binary file Thransmit image from internal flash Switch to user application SW Version HW Info CRC correct? CRC correct? Goto Menu Goto Menu Program the Flash Write Data to File Complete? Complete? Update Flag Goto Main Menu Display the name and size of received file Goto Main Menu Figure 1. UART Bootloader Flowchart 5

UART Bootloader Operation 7 UART Bootloader Operation www.ti.com The UART bootloader is built with Code Composer Studio v5.x and loaded through the JTAG port into the lower part of the program memory at 0x0000. Figure 2. The UART Bootloader is Loaded Through the JTAG port After HDK reset, the start-up code copies the Flash API of bootloader from Flash to SRAM, and execute the bootloader in Flash. First, it will checks to see if the GPIO_A7 pin is pulled. If GPIO-A7 is pulled LOW, the application code is forced to be updated. The GPIO pin check can be enabled with ENABLE_UPDATE_CHECK in the bl_config.h header file. On TMS570LS04x HDK, the push button S1can toggle GPIO-A7. Then, it will check the flag at 0x0007FF0. If the flag is a valid number (0x5A5A5A5A), the bootloader will jump to the application code at 0x00020000. If the flag is not the valid number, it will configure the UART, then start to update the user application code by calling UpdaterUart(). After all the application code is programmed successfully, the flag is also updated. 6

www.ti.com UART Bootloader Operation The updating results in Figure 3 displayed in the HyperTerminal window. Figure 3. UART Bootloader Main Menu 1. Download the user application code to TMS570LS04x Flash. To download a binary file via HyperTerminal to the TMS570LS04x internal Flash, follow the procedure below: Press 1 on the keyboard to choose the menu Download image to internal Flash. Then, in the Transfer menu, select Send file In the Filename field, type the name and the path of the binary file to be sent. In the Protocol list, choose the Ymodem protocol Click the Send button. Following these steps, the bootloader loads the binary file into the TMS570LS04x internal Flash. The bootloader will display the file name, and file size in the Hyperterminal window. Figure 4. User Application Code is Loaded Through the UART Bootloader 7

UART Bootloader Operation www.ti.com 2. Upload the application code from TMS570LS04x Flash To upload a copy of the internal Flash memory started from the user application address, do as follows: Press 2 on the keyboard to select Upload image from the TMS570LS04x internal Flash Select Receive File in the Transfer menu. Choose the Directory of the binary file you want to create From the Protocol list, select the Ymodem protocol Click on the Receive button The file UploadedApplicationImage.bin is uploaded to the directory you defined in step 2. 3. Execute the application. Once the new application is downloaded successfully, press 3 on the keyboard to select the Execute. 4. Get Bootloader Software Version Figure 5. UART Bootloader Jumps to Application Code To get the software version, press 4 on the keyboard to retrieve the SW version from TMS570LS04x UAR bootloader. 5. Get the TMS570LS04x Device Information To get the device information, press 5 on the keyboard to retrieve the device information from TMS570LS04x UAR bootloader. 8

www.ti.com HyperTerminal Configuration 8 HyperTerminal Configuration The bootloader requires a PC running HyperTerminal with the following settings: Figure 6. COM Port Properties 9 References TMS570LS0432/0332 16/32-Bit RISC Flash Microcontroller Data Manual (SPNS186) F021 Flash API Version 2.00.01 Reference Guide (SPNU501) 9

IMPORTANT TICE Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services per JESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All semiconductor products (also referred to herein as components ) are sold subject to TI s terms and conditions of sale supplied at the time of order acknowledgment. TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI s terms and conditions of sale of semiconductor products. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not necessarily performed. TI assumes no liability for applications assistance or the design of Buyers products. Buyers are responsible for their products and applications using TI components. To minimize the risks associated with Buyers products and applications, Buyers should provide adequate design and operating safeguards. TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right relating to any combination, machine, or process in which TI components or services are used. Information published by TI regarding third-party products or services does not constitute a license to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI. Reproduction of significant portions of TI information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for such altered documentation. Information of third parties may be subject to additional restrictions. Resale of TI components or services with statements different from or beyond the parameters stated by TI for that component or service voids all express and any implied warranties for the associated TI component or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards which anticipate dangerous consequences of failures, monitor failures and their consequences, lessen the likelihood of failures that might cause harm and take appropriate remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components in safety-critical applications. In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI s goal is to help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and requirements. Nonetheless, such components are subject to these terms. No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties have executed a special agreement specifically governing such use. Only those TI components which TI has specifically designated as military grade or enhanced plastic are designed and intended for use in military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components which have not been so designated is solely at the Buyer's risk, and that Buyer is solely responsible for compliance with all legal and regulatory requirements in connection with such use. TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of non-designated products, TI will not be responsible for any failure to meet ISO/TS16949. Products Applications Audio www.ti.com/audio Automotive and Transportation www.ti.com/automotive Amplifiers amplifier.ti.com Communications and Telecom www.ti.com/communications Data Converters dataconverter.ti.com Computers and Peripherals www.ti.com/computers DLP Products www.dlp.com Consumer Electronics www.ti.com/consumer-apps DSP dsp.ti.com Energy and Lighting www.ti.com/energy Clocks and Timers www.ti.com/clocks Industrial www.ti.com/industrial Interface interface.ti.com Medical www.ti.com/medical Logic logic.ti.com Security www.ti.com/security Power Mgmt power.ti.com Space, Avionics and Defense www.ti.com/space-avionics-defense Microcontrollers microcontroller.ti.com Video and Imaging www.ti.com/video RFID www.ti-rfid.com OMAP Applications Processors www.ti.com/omap TI E2E Community e2e.ti.com Wireless Connectivity www.ti.com/wirelessconnectivity Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265