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

Similar documents
AN Automatic RS-485 address detection. Document information

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

AN10955 Full-duplex software UART for LPC111x and LPC13xx

AN Sleep programming for NXP bridge ICs. Document information

AN LPC1700 Ethernet MII Management (MDIO) via software. Document information. LPC1700, Ethernet, MII, RMII, MIIM, MDIO

uip, TCP/IP Stack, LPC1700

Installation Manual Installation Manual for the MicroWave Office design kit version v1.0

AN10688_1. PN532C106 demoboard. Document information. NFC, PN532, PN532C106, demoboard. This document describes PN532C106 demoboard.

ES_LPC5410x. Errata sheet LPC5410x. Document information

UM QN908x Quick Start. Document information. QN908x, Quick Start, Development Kit, QN9080 DK, QN9080 Development Kit

LPC1300, FM+, Fast-mode Plus, I 2 C, Cortex-M3

Using LPC11Axx EEPROM (with IAP)

ES_LPC81xM. Errata sheet LPC81xM. Document information

Installation Manual. Installation Manual for the ADS design kit version v2.1. ADS Design kit Windows Linux Unix Instruction Manual RF small signal

AN Interfacing Philips Bridge IC with Philips microcontroller. Document information

AN SC16IS760/762 Fast IrDA mode. Document information

Installation Manual Installation Manual for the Ansoft Designer v5.0 design kit version v1.0

OM13071 LPCXpresso824-MAX Development board

PCA9633 demonstration board OM6282

AN10917 Memory to DAC data transfers using the LPC1700's DMA

MF1 MOA4 S50. Contactless Chip Card Module Specification. This document gives specifications for the product MF1 MOA4 S50.

LPC81x, LPC82x, LPC83x Errata Sheet and Datasheet Update for Vdd.1 Errata

AN LPC82x Touch Solution Quick Start Guide. Document information. Keywords

IMPORTANT NOTICE. As a result, the following changes are applicable to the attached document.

IMPORTANT NOTICE. use

UM NVT2008PW and NVT2010PW demo boards. Document information

UM NVT2001GM and NVT2002DP demo boards. Document information

550 MHz, 34 db gain push-pull amplifier

UM PCA9698 demonstration board OM6281. Rev September Document information

UM NXP USB PD shield board user manual COMPANY PUBLIC. Document information

UM LPC54018 IoT module. Document information. LPC54018, OM40007, Amazon FreeRTOS, AWS, GT1216 LPC54018 IoT module user manual

UM PCAL6524 demonstration board OM Document information

UM User Manual for LPC54018 IoT Module. Rev November Document information

UM ISP1181x Microcontroller Eval Kit. Document information. Keywords isp1181a, isp1181b, usb, universal serial bus, peripheral

UM PCSerial. Document information. PCSerial, MFRD52x development board, MFRC52x, PN51x design-in kit

AN Design guidelines for COG modules with NXP monochrome LCD drivers. Document information

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

NXP AN11528 sensor Application note

UM LPC General Purpose Shield (OM13082) Rev November Document information. Keywords

UM EEPROM Management of PN746X and PN736X. User manual COMPANY PUBLIC. Rev February Document information

OM bit GPIO Daughter Card User Manual

UM PR533 - PCSC Tool. User manual COMPANY PUBLIC. Rev November Document information

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

UM OM bit GPIO Daughter Card User Manual. Document information. Keywords Abstract

LH79524/LH Application Note. Static Memory System Design INTRODUCTION STATIC MEMORY OPERATION

AN2430 Application note

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

QPP Proprietary Profile Guide

MF1ICS General description. Functional specification. 1.1 Key applications. 1.2 Anticollision. Energy. MIFARE card contacts La, Lb.

LPC540xx_LPC54S0xx. Errata sheet LPC540xx_LPC54S0xx. Document information

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

UM10139 Volume 1: LPC214x User Manual

QSG DAC1x08D+ECP3 DB

ES_LPC5411x. Errata sheet LPC5411x. Document information LPC54113J256UK49, LPC54114J256UK49, LPC54113J128BD64, LPC54113J256BD64, LPC54114J256BD64

U-boot quick start guide

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

AN10428 UART-SPI Gateway for Philips SPI slave bridges

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

AN Full-duplex software UART for LPC2000. Document information

AN NTAG I²C plus memory configuration options. Application note COMPANY PUBLIC. Rev June Document information

Low forward voltage Ultra small SMD plastic package Low capacitance Flat leads: excellent coplanarity and improved thermal behavior

YHY202D RfidLoginer Datasheet

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

How to use the NTAG I²C plus for bidirectional communication. Rev June

AN10254 Philips ARM LPC microcontroller family

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

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

Dual back-to-back Zener diode

Total power dissipation: 500 mw Small plastic package suitable for surface-mounted design Wide working voltage range Low differential resistance

IoT Sensing SDK. Getting started with IoT Sensing SDK (ISSDK) v1.7 middleware. Document information. IoT Sensing SDK, ISSDK, MCUXpresso, middleware

UM10766 User manual for the I2C-bus RTC PCF85263A demo board OM13510

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

CAUTION This device is sensitive to ElectroStatic Discharge (ESD). Therefore care should be taken during transport and handling.

UM10120 Volume 1: LPC213x User Manual

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

ES_LPC2468. Errata sheet LPC2468. Document information

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

Broadband system applications i.e. WCDMA, CATV, etc. General purpose Voltage Controlled Attenuators for high linearity applications

AN5123 Application note

Strike the keyboard for you when it sniffing the tag!

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

STB-CE v Overview. 2 Features. Release notes for STB-CE v What's new in STB-CE v2.5

PESD5V0U2BT. 1. Product profile. Ultra low capacitance bidirectional double ESD protection diode. 1.1 General description. 1.

PMEG2010EH; PMEG2010EJ; PMEG2010ET

AN2792 Application note

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

In data sheets and application notes which still contain NXP or Philips Semiconductors references, use the references to Nexperia, as shown below.

Wafer Fab process Assembly Process Product Marking Design

PRTR5V0U2X Ultra low capacitance double rail-to-rail ESD protection diode Rev January 2008 Product data sheet

PMEG3015EH; PMEG3015EJ

AN BGA301x Wideband Variable Gain Amplifier Application. Document information. Keywords

AN2667 Application note

PESD5V0U1BA; PESD5V0U1BB; PESD5V0U1BL

AN BGA GHz 18 db gain wideband amplifier MMIC. Document information. Keywords. BGA3018, Evaluation board, CATV, Drop amplifier.

PMEG1030EH; PMEG1030EJ

SL2ICS5311EW/V7. Name Description. Diameter: 8 Thickness: Material: ground + stress releave. Roughness: R t max. 5 μm. Chip size: 940 x 900 μm 2

Transcription:

Rev. 03 13 September 2006 Application note Document information Info Keywords Abstract Content ARM ISP, bootloader Entering ISP mode is normally done by sampling a pin during reset. This application note describes a method whereby ISP mode may be entered while running in user code.

Revision history Rev Date Description 03 20060913 1. In section 3, an additional step was added which involved the Fractional Baud Rate generator. 02 20051025 1. Some key changes were done to the steps needed to enter ISP mode in Section 3 2. Boot flowchart was added for the LPC213x and LPC214x devices. 01 20050204 Initial version Contact information For additional information, please visit: http://www.nxp.com For sales office addresses, please send an email to: sales.addresses@www.nxp.com _3 Application note Rev. 03 13 September 2006 2 of 10

1. Introduction 2. LPC2000 ISP overview In-System programming (ISP) is a method of programming and erasing the on-chip flash or RAM memory using the bootloader software and a serial port. The part may reside in the end-user system. The flash bootloader provides an In-System Programming interface for programming the on-chip flash or RAM memory. This bootloader is located in the upper 8 kb of flash memory, it can be read but not written to or erased. In many cases it may be desirable to enter ISP mode without resetting the device, while running user code. A method of doing this, which involves only a small amount of code, is described in this document. The flash bootloader code is executed every time the part is powered on or reset. The loader can execute the ISP command handler or pass execution to the user application code. A LOW level, after reset, at the P0.14 pin is considered the external hardware request to start the ISP command handler. The bootloader samples this pin during reset. Assuming that a proper signal is present on the X1 pin when the rising edge on the Reset pin is generated, it may take up to 3 ms before P0.14 is sampled and the decision on whether to continue with user code or ISP handler is made. If P0.14 is sampled LOW and the watchdog overflow flag is set, the external hardware request to start the ISP command handler is ignored. If there is no request for the ISP command handler execution (P0.14 is sampled HIGH after reset), a search is made for a valid user program. If a valid user program is found then the execution control is transferred to it. If a valid user program is not found, the auto-baud routine is invoked. As Pin P0.14 is used as the hardware request for ISP, it requires special attention. Since P0.14 is in high impedance mode after reset, it is important that the user provides external hardware (a pull-up resistor or other device) to put the pin in a defined state. Otherwise unintended entry into ISP mode may occur. Fig 1 shows the boot sequence of the LPC2100 devices. Fig 3 shows the boot sequence of LPC2000 devices (Bootloader revisions 1.61 and later, not applicable to the LPC210x devices). Fig 3 shows the boot sequence of the LPC213x and LPC214x devices. _3 Application note Rev. 03 13 September 2006 3 of 10

Fig 1. Boot process flowchart (LPC210x devices) _3 Application note Rev. 03 13 September 2006 4 of 10

Fig 2. Boot Process flowchart (LPC2000 Bootloader revisions 1.61 and later, not applicable to the LPC210x devices) _3 Application note Rev. 03 13 September 2006 5 of 10

Fig 3. Boot Process flowchart (LPC213x and LPC214x devices) _3 Application note Rev. 03 13 September 2006 6 of 10

3. Entering ISP Mode from User Code The steps involved in entering ISP mode from user code are as follows: Configure the RXD0 pin (UART 0 receive) as input. This is done by entering the appropriate values in the PINSEL0 and IODIR0 registers. Configure P0.14 as an output pin. Clear P0.14 (Set low) Disable interrupts by setting the corresponding bits in the VIC Interrupt Enable Clear register (VICIntEnClear at address 0xFFFF F014) for any interrupt source that was previously enabled for interrupts. If the PLL is connected, disconnect it (Recommended). Set the Peripheral Bus Divider to ¼ if needed. If the UART is equipped with a Fractional Baud Rate generator then the Fractional Divider register (FDR) should be set to its reset value (This is not shown in the code below). Restore Timer1 to its reset state. Timer 1 is used by the ISP to auto baud. Re-Map the interrupt vectors to the boot block. Invoke the bootloader by calling a function that is located at the bootloader entry point, i.e. the reset vector at 0x00. The code to perform the operations listed above is as follows: #define MEMMAP (*((volatile unsigned int *) 0xE01FC040)) #define IODIR0 (*((volatile unsigned int *) 0xE0028008)) #define IOCLR0 (*((volatile unsigned int *) 0xE002800C)) #define PINSEL0 (*((volatile unsigned int *) 0xE002C000)) #define VPBDIV (*((volatile unsigned int *) 0xE01FC100)) #define PLLCON (*((volatile unsigned int *) 0xE01FC080)) #define PLLFEED (*((volatile unsigned int *) 0xE01FC08C)) #define VICINTENCLR (*((volatile unsigned int *) 0Xfffff014)) #define TIMER1_PR (*((volatile unsigned int *) 0xE000800C)) #define TIMER1_MCR (*((volatile unsigned int *) 0xE0008014)) #define TIMER1_CCR (*((volatile unsigned int *) 0xE0008028)) void (*bootloader_entry)(void); unsigned long temp; void init(void) { temp = PINSEL0; /* Connect RXD0 & TXD0 pins to GPIO */ PINSEL0 = temp & 0xFFFFFFF3; /* Select P0.14 as an output and P0.1 as an input */ temp = IODIR0; temp = temp 0x4000; temp = temp & 0xFFFFFFFD; IODIR0 = temp; /* Clear P0.14 */ IOCLR0 = 0x4000; _3 Application note Rev. 03 13 September 2006 7 of 10

/* Disable Interrupts in the VIC*/ VICINTENCLR=0X ; /* /* */ Disconnect PLL if you want to do ISP at crystal frequency. Otherwise you need to pass the PLL freq when bootloader goes in ISP mode. cclk = crystal when PLL is disconnected cclk = PLL freq when PLL is connected. Disconnecting the PLL is recommended. */ PLLCON = 0x0; PLLFEED = 0xAA; PLLFEED= 0x55; Set the VPB divider to 1/4 if your application changes the VPBDIV value. The bootloader is hard-coded to use the reset value of VPBDIV register VPBDIV = 0x0; /* Restore reset state of Timer1 */ TIMER1_PR=0x0; TIMER1_MCR=0x0; TIMER1_CCR=0x0; /* Map bootloader vectors */ MEMMAP = 0x0; /* Point to bootloader entry point i.e. reset vector 0x0 */ } /* bootloader_entry = (void (*)(void))(0x0); Invoke the bootloader The bootloader will read pin P0.14 to detect if ISP is forced Since P0.14 is configured as an output and set to 0, the bootloader will go in ISP mode. */ int main(void) { init(); while(1) bootloader_entry(); } _3 Application note Rev. 03 13 September 2006 8 of 10

4. Legal information 4.1 Definitions Draft The document is a draft version only. The content is still under internal review and subject to formal approval, which may result in modifications or additions. NXP Semiconductors does not give any representations or warranties as to the accuracy or completeness of information included herein and shall have no liability for the consequences of use of such information. 4.2 Disclaimers General Information in this document is believed to be accurate and reliable. However, NXP Semiconductors does not give any representations or warranties, expressed or implied, as to the accuracy or completeness of such information and shall have no liability for the consequences of use of such information. Right to make changes NXP Semiconductors reserves the right to make changes to information published in this document, including without limitation specifications and product descriptions, at any time and without notice. This document supersedes and replaces all information supplied prior to the publication hereof. Suitability for use NXP Semiconductors products are not designed, authorized or warranted to be suitable for use in medical, military, aircraft, space or life support equipment, nor in applications where failure or malfunction of a NXP Semiconductors product can reasonably be expected to result in personal injury, death or severe property or environmental damage. NXP Semiconductors accepts no liability for inclusion and/or use of NXP Semiconductors products in such equipment or applications and therefore such inclusion and/or use is for the customer s own risk. Applications Applications that are described herein for any of these products are for illustrative purposes only. NXP Semiconductors makes no representation or warranty that such applications will be suitable for the specified use without further testing or modification. 4.3 Trademarks Notice: All referenced brands, product names, service names and trademarks are property of their respective owners. _3 Application note Rev. 03 13 September 2006 9 of 10

5. Contents 1. Introduction...3 2. LPC2000 ISP overview...3 3. Entering ISP Mode from User Code...7 4. Legal information...9 4.1 Definitions...9 4.2 Disclaimers...9 4.3 Trademarks...9 5. Contents...10 Please be aware that important notices concerning this document and the product(s) described herein, have been included in the section 'Legal information'. For more information, please visit: http://www.nxp.com For sales office addresses, email to: sales.addresses@www.nxp.com Date of release: 13 September 2006 Document identifier: _3