Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: Any way to launch ISP ?

2004-11-18 by Richard

Here is some code that will invoke the bootloader which will read 
P0.14 (after you have set it low) and initiate ISP.

Richard

/* ISP Invocation code – Richard Soennichsen - Philips 
Semiconductors  */
/* 								
	10/11/2004						
							*/

/* define the SFR addresses, this may already be handled in a header 
file */

#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))


void (*bootloader_entry)(void);  /* Declare the entry function  */
unsigned long temp;					/*Temporary 
variable    */

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 */
/* P0.1 is sampled to determine baud rate             */
temp = IODIR0; 
temp = temp | 0x4000;
temp = temp & 0xFFFFFFFD;
IODIR0 = temp;

IOCLR0 = 0x4000;    	/* Clear P0.14 */  

/*
   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;				/ disconnect the PLL
	*/
   *pllfeed = 0xAA;
   *pllfeed = 0x55;
*/

/*
   Set the VPB divider to 1/4 if you application changes the VPBDIV 
value.
   The bootloader is hard-coded to use the reset value of VPBDIV 
register
   *vpbdiv = 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();
	bootloader_entry();
  }







--- In lpc2000@yahoogroups.com, Owen Mooney <ojm@s...> wrote:
> Yup There shore is !
> 
> In the LPC2106 anyway. I dunno about the rest of them. But it 
requrires a reset of the micro!
> 
> Use the IAP instructions to erase the first block of flash memory.
> 
> Drop the supply and bring it up again, and the chip detects the 
lost of a valid program 
> and automatically jumps to the ISP.
> 
> I use this to update the firmware with P0.14 buried deep in a hunk 
of expoxy, but watch it,
> Once the ISP is running anyone can steal your program !! I use a 
very unlikely pass code in the operating firmware to do this.
> 
> Owen Mooney
> 
> Subject: 
> 
> 
> Is there any way to launch the ISP software without having the BSL
> jumper on?  (i.e. does it have an entry point that does not check 
P0.14?)

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.