Yahoo Groups archive

Lpc2000

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

Message

difficulties at using IAP routines

2005-07-01 by cris_ullmann

Hello friends,

I'm still pretty unexperienced in programming the LPC2xxx processors. 
I want read and write the internal flash using IAP. At first, I tried 
to read the processor ID from the flash.

My code is:

int IAP_ID()
{
#define IAP_LOCATION 0x7FFFFFF1
unsigned int command[5];
unsigned int result[2];
typedef void (*IAP)(unsigned int[],unsigned int[]);
IAP iap_entry;

int ID;
int Ergebnis;
  __DISABLE_INTERRUPT();
 iap_entry=(IAP)IAP_LOCATION;
 command[0]=54;             //read par ID
 result[0]=0;
 iap_entry(command,result);
 Ergebnis=result[0];
 ID=result[1];
 return Ergebnis;
} 

By the way, I use the ICCARM compiler, the boot loader version is 1.64

Is there anybody who can help me? As I learned from this forum, the 
problem might laying in switching to the thumb mode when calling the 
IAP-routine. Who do I have to do this?

Best regards

Cris

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.