Implementing In-Application Programming on the ADuC702x

Similar documents
APPLICATION NOTE 3575 In-Application Programming (IAP) of the MAXQ7665 Sector-Erasable Program and Data Flash

Boot ROM Design Specification

Keywords: maxq microcontrollers, data flash, in-application programming, in circuit programming, flash, microcontroller, MAXQ7663, MAXQ7664

Table of Contents List of Figures... 2 List of Tables Introduction Main features Function description On-chip Flash memo

Contents. Cortex M On-Chip Emulation. Technical Notes V

UM LPC2101/02/03 User manual. Document information

UM MPT612 User manual. Document information

Kinetis Bootloader to Update Multiple Devices in a Field Bus Network

Chapter 4. Enhancing ARM7 architecture by embedding RTOS

ECE254 Lab3 Tutorial. Introduction to MCB1700 Hardware Programming. Irene Huang

Memory Map for the MCU320 board:

ELC4438: Embedded System Design ARM Cortex-M Architecture II

Samsung S3C4510B. Hsung-Pin Chang Department of Computer Science National Chung Hsing University

Course Introduction. Purpose: Objectives: Content: 27 pages 4 questions. Learning Time: 20 minutes

HT32 Series In-System / In-Application Programmer User Manual

Programming in the MAXQ environment

AN LPC1700 secondary USB bootloader. Document information. LPC1700, Secondary USB Bootloader, ISP, IAP

AN2430 Application note

Keywords: MAXQ7665C, page erasable, flash, MAXQ, In-application, programming

AN10254 Philips ARM LPC microcontroller family

Lab 1 Introduction to Microcontroller

8051 Microcontroller

acret Ameya Centre for Robotics & Embedded Technology Syllabus for Diploma in Embedded Systems (Total Eight Modules-4 Months -320 Hrs.

Diploma in Embedded Systems

PMC-DA Channel 16 Bit D/A for PMC Systems REFERENCE MANUAL Version 1.0 June 2001

AN1576 APPLICATION NOTE

Release Notes for ADSP-CM41x EZ-Kit Lite Board Support Package For Keil MDK

ABSTRACT. Table of Contents

IP-48DAC channel 16-bit Digital/Analog Converter With memory Industry Pack Module PROGRAMMING MANUAL Version 1.

Interrupt/Timer/DMA 1

Megawin 8051 ISP via COM Port

ADuC7XXX MicroConverter Get Started Guide

AN5123 Application note

Hello, and welcome to this presentation of the STM32F7 System Configuration Controller.

Boot Loader for the Z51F6412 MCU

XC800 Family AP Application Note. Microcontrollers. Programming the BMI value in the XC82x and XC83x products V1.0,

Boot Loader. Bootloader

OEM-Product Catalogue

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

Application Note 606 Configuring Keil PK51 Tools to Support 24-Bit Contiguous Addressing Mode

Evaluation board for NXP LPC2103. User Guide. Preliminary Version updated 27 th Aug TechToys Company All Rights Reserved

AN-946 APPLICATION NOTE

ATmega128. Introduction

MSP430F149 P3.4/UTXD0 P3.5/URXD0 P1.5 P1.6 P1.7 MSP430F149 P1.0 P5.4 P5.3 P5.2 P5.1. Figure B-1. BSL Replicator Block Diagram

VORAGO VA108x0 Bootloader application note

XC800 Family AP Application Note. Microcontrollers. Capacitive-Touch Color Wheel Implementation V1.0,

Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other product or service names are the property of their

AN4045 Application note

Introduction to ARM LPC2148 Microcontroller

CPCI-IPC. Intelligent DSP Based Dual IndustryPack Carrier for CompactPCI systems REFERENCE MANUAL Version 2.

ECE254 Lab3 Tutorial. Introduction to Keil LPC1768 Hardware and Programmers Model. Irene Huang

QuickStart Instructions. Using Keil's ULINK and the Keil ARM/µVision3 Software Development Tool Chain

The task of writing device drivers to facilitate booting of the DSP via these interfaces is with the user.

LAB1. Get familiar with Tools and Environment

Today's plan: Announcements General Strategy Microcontroller programming concepts/last bits of assembly Activity 2

EasyIAP Software Example User s Guide

By the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab

ECE2049 E17 Lecture 4 MSP430 Architecture & Intro to Digital I/O

NEC 78K0- Family On-Chip Emulation

LEGO RCX Hitachi H8/3292

DC6688EMT User Manual

8 MEMORY INTERFACE. Overview. Program Memory and Data Memory. Figure 8-0. Table 8-0. Listing 8-0.

Introduction to the MC9S12 Hardware Subsystems

CPCI-AD8. Intelligent DSP Based 8 Channel Analog Input Card for 3U CompactPCI systems REFERENCE MANUAL Version 1.

The purpose of this course is to provide an introduction to the RL78's flash features and archectecture including security features, code and data

Evaluation Board. For NXP - Philips LPC All rights reserved

UM10139 Volume 1: LPC214x User Manual

CEC 450 Real-Time Systems

M16C/62 APPLICATION NOTE. Using the Expanded Memory Mode with the M16C/ Abstract. 2.0 Introduction. 3.0 Memory Expansion Mode

CPCI-AD32. Intelligent DSP Based 32 Channel Analog Input Card for 3U CompactPCI systems REFERENCE MANUAL Version 1.

UM10120 Volume 1: LPC213x User Manual

UM LPC2104/2105/2106 User manual. Document information

Megawin 8051 ISP-ICP Programmer

TMS320LF240x-A Flash Programming

HC11 Instruction Set

AN4491 Application note

MC9S12 Address Space

AN2606 Application note

Memory Controller. Speaker: Tzu-Wei Tseng. Adopted from National Taiwan University SoC Design Laboratory. SOC Consortium Course Material

AN Entering ISP mode from user code. Document information. ARM ISP, bootloader

Lab 9: On-Board Time Generation and Interrupts

Product Update. Errata to Z8 Encore! 8K Series Silicon. Z8 Encore! 8K Series Silicon with Date Codes 0402 and Later

Infineon C167CR microcontroller, 256 kb external. RAM and 256 kb external (Flash) EEPROM. - Small single-board computer (SBC) with an

AN10210 Using the Philips 87LPC76x microcontroller as a remote control transmitter

Microprocessor or Microcontroller Not just a case of you say tomarto and I say tomayto

HOW TO DIVIDE BOOT AND FLASH AREAS

Megawin 8051 OCD ICE

Advanced Embedded Systems

Lecture test next week

ISPV3 Programmer s Guide. This guide addresses the features, setup and operation of the CRD89C51xxx microcontrollers with ISPV3 firmware.

Interrupts. Embedded Systems Interfacing. 08 September 2011

Centre for Instrumentation, Control and Automation User s Guide to the MAD 2 Microcontroller Board

Graduate Institute of Electronics Engineering, NTU Advanced VLSI SOPC design flow

AT91 ARM Thumb Microcontrollers AT91FR40162S. Preliminary

F²MC-8FX FAMILY MB95200H/210H SERIES HOW TO USE DBG PIN 8-BIT MICROCONTROLLER APPLICATION NOTE

S1C17 Family Application Note S1C17 Series Boot Loader Sample Software

ARDUINO MEGA INTRODUCTION

Microcontrollers. Program organization Interrupt driven I/O. EECE 218 Microcontrollers 1

The industrial technology is rapidly moving towards ARM based solutions. Keeping this in mind, we are providing a Embedded ARM Training Suite.

DEVICE DRIVERS AND TERRUPTS SERVICE MECHANISM Lesson-15: Writing Device Driving ISRs in a System

Transcription:

Implementing In-Application Programming on the ADuC702x By Johnson Jiao [Johnson.Jiao@analog.com] and Raven Xue [Raven.Xue@analog.com] Background The ADuC702x Precision Analog Microcontroller provides a serial downloader for loading an assembled program into the on-chip program Flash/EE memory via the serial port on a standard PC, but entering this mode requires a user to manually tie the BM pin low while the ADuC702x is reset or powered on. Users who want to upgrade the program in an industrial environment will not normally have access to this pin, making it difficult to update the application program in this way. In-application programming (IAP) allows upgrades without touching the board. This article provides an easy method for ADuC702x users to upgrade their programs. IAP function methodology The ADuC702x s factory configured boot-loader is located in the upper end of Flash memory, from 0x0008F800 to 0x0008FFFF. The ADuC702x will automatically enter this area after a reset or power-up cycle if the BM pin is pulled low. Normally, however, the BM pin is tied high after all programs have been downloaded into the FLASH/EE, so new programs cannot be downloaded without changing the BM logic. To introduce an IAP function that can re-download assembled application code to the desired flash address range without changing the hardware status of the BM pin, three programs must be located in certain Flash memory addresses from 0x00080000 to 0x0008FFFF, as shown below. (1). 0x00080000 to 0x00080FFF, IAP function program. Think of this as a user-designed boot-loader. The user can change the end address according to the IAP function program size. (2). 0x00081000 to 0x0008F7FF, User Application program. This is the actual application designed by the user. When the IAP function is running, this area can be replaced by a new application program. (3). 0x0008F800 to 0x0008FFFF, Factory Configured Boot-Loader. This code is hidden and cannot be accessed by the user. Once the user has downloaded the IAP and application programs into the desired areas as shown above, operation proceeds as follows. When a normal reset (BM pin is high) occurs, execution automatically starts in the factory programmed internal configuration code. Next, the ADuC702x jumps to the Interrupt vector address, 0x00000000, to execute the user s reset exception routine. By default, the Flash/EE is mirrored at the bottom of the memory array. Next, ADuC702x will execute the IAP function program. This will initialize hardware configurations for the UART and timer, and will enable UART receive and transmit interrupts and a five second timer interrupt. During this time, the ADuC702x will wait five seconds for

the host computer to command an upgrade. If the ADuC702x doesn t receive this command within five seconds, the pointer will jump to the user application location at 0x00081040 to execute the user application program; this is a normal reset action. If the ADuC702x receives a command, 0xA, for example, within five seconds, it will continue executing the IAP function program, copy the IAP program into SRAM, and enable REMAP function. The interrupt vector and the upgrade function are both in SRAM. During download, the Flash memory will provide storage. The ADuC702x is now expecting to receive the package message from the host computer, and save the new code in the Flash user application area from 0x00081000 to 0x0008F7FF. When the download is complete, the IAP function will reset the entire chip. If no further command is received from the UART, the pointer will jump to the upgraded user application program after five seconds. The flowchart is shown in Figure 1: Figure 1. Main Program Flowchart As shown in Figure 2, two types of packages can be sent from the host computer to the IAP program: a full package, where the first byte is counter value 0xFF and the following 256 bytes are content; or a smaller package, where the first byte stands for the length of the package and the following bytes are content. If, for example, the counter value is 0x10, the package has 16 bytes.

Figure 2. Upgrade Function Flow Chart Some important precautions for the ARM7TDMI IAP function follow. Interrupt Vector Table and Remap ARM interrupt vectors are mirrored at the bottom of the memory array, from 0x00000000 to 0x0000001F. Linked interrupt ISR address are located from 0x00000020 to 0x0000003F. By default, the Flash/EE is mirrored at the bottom of the memory array when a reset occurs. The core will jump to Flash to search the ISR entry when an interrupt is triggered. In upgrade mode, however, the Flash acts as a storage memory that will be erased and rewritten, so locating interrupt vectors in Flash will result in an error. To avoid this problem, the user must use the REMAP function, which mirrors the SRAM at the bottom of the memory array. This facilitates execution of interrupt routines from SRAM instead of from Flash. To use the REMAP function, the user must first copy the interrupt vector table from Flash to SRAM, and the first 64 bytes in SRAM can t be used as normal. See Figure 3. Function run in SRAM IAP provides the functionality to erase and rewrite Flash without pulling the BM pin low, but core operation is waiting until the requested read or erase mode is completed. To solve this problem, put all the function including ISR into SRAM and execute from there. With Keil uvision3 v3.23, the user could execute the function in SRAM as follows: void Ram_Function() ram // ram attribute indicates code is is placed in RAM

Figure 3. FIQ and IRQ ISR Flowchart Locate RO and RW segment in desired area. In Project Options for Target IAP_boot LA Locate, the user could deselect Use Memory Layout from Target Dialog, and assign RO and RW segment in User Classes as below: DATA (0x10040-0x11FFF), CODE (0x80000-0x80FFF), CONST (0x80000-0x80FFF), ERAM(0x10040-0x11FFF) By this assignment, the area from 0x10040 to 0x11FFF can be used as an RW segment, the area from 0x80000 to 0x80FFF can be used as an RO segment, and the function can be run in SRAM at locations from 0x10040 to 0x11FFF. User Application arrangement. In the user s application, RO and RW should be assigned to the segment reasonably. In Project Options for Target IAP_boot LA Locate, user could de-select Use Memory Layout from Target Dialog, and assign RO and RW segment in User Classes as below:

DATA (0x10040-0x11FFF), CODE (0x81000-0x8F7FF), CONST (0x81000-0x8F7FF) By this assignment, the area from 0x10040 to 0x11FFF can be used as an RW segment, and the area from 0x81000 to 0x8F7FF can be used as an RO segment. Please note that the startup code should be modified to assign the startup object code memory area. This can be modified in startup code as shown: AREA STARTUPCODE, CODE, AT 0x00081000 The startup object code will be located from 0x00081000. In the main program, the user must first copy the interrupt vector table from Flash 0x00081000 to 0x0008103F and enable the REMAP function. Then, the user could write the application as normal.