Yahoo Groups archive

Lpc2000

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

Message

Re: Flash problem

2005-02-09 by Leighton Rowe

> This is the iap function:
>  
> void iap (unsigned *cmd,unsigned *rslt,unsigned entry)
> {
>  asm("mov r15,r2");
> }

You're overwriting the PC (program counter) which is one of the 
scariest things u can do. Usually this results in prefetch aborts. 
You can to branch to the IAP bootloader address location by using a 
function pointer.


The code below is some example code taken from the User Manual for 
the lpc you are using.

#define IAP_LOCATION 0x7ffffff1    //address of IAP BL

unsigned long command[5];
unsigned long result[2];

typedef void (*IAP)(unsigned int [],unsigned int[]); //function ptr

IAP iap_entry;   
iap_entry=(IAP) IAP_LOCATION;  // function pointer declared and set 
to address location

iap_entry (command, result);   //done

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.