Main Menu

IAP routines

Started by GIGI, April 07, 2004, 04:41:04 AM

Previous topic - Next topic


I would like to use IAP routine to erase the FLASH memory of a LPC932 microcontroller.
But they don't work.
Then I "blank check" the memory with Flash memory and the program says me that  the memory isn't blank.

Do I need to set some other particular registers or flags to use the IAP routine at memory 0xFF00 ?

Andy Ayre

If you look in the Technical Library on this web site you will find an IAP library for the LPC932 which you can either use or compare with what you have to see if you are missing any steps.

Embedded Systems Academy, Inc.
support at esacademy dot com


We are using the P89LPC31 microcontroller and we want to use the IAP functions.
 We have followed the procedure described in the IAP library in this web site but it seems that once we make the "LCALL" to the IAP function, the microcontroller ends up receiving a RESET.
 We want to read the BOOT_VECTOR, and we have tried two ways of doing it, with the same results:
 (Watchdog is disabled and the brownout detection enabled using the Flash-Magic programme.)


 MOV  R7,#2
 CLR     EA                               ; disable interrupts

(where IAP_READ=0xFF0B)

 MOV  R7,#2
 MOV  A,#3
 CLR     EA                               ; disable interrupts
 MOV    ACC,#3

( where PGM_MTP=0xFF00)
 Do we need to do something else? Is there anything wrong in our code?

 Thanks in advance.



The entry point for the IAP routines in FF03h. A call to FF00h will cause te jump to the reset vector. This change occurred in V2 code to toughten up the processor against unintended code walk-up from poor resets.

Andy - you may need to check your web library to ensure it makes use of the correct entry point.

Also, why are you calling any address that is not the documented entry point? You open yourself up to ANY code changes made to the IAP support routines.

Rather, use function 3 as your second example shows (note that you load the accumulator twice, where only once is required).

Can I suggest that you grap the latest copy of the data sheets from the Philips web site? I can't help feeling that your confusion, and therefore approach, is caused by having out of date data sheets.

Best regards,

support at acqura dot com


Thanks! We have tested it (PGM_MTP=0xff03) and it works!

We can't find a data sheet in the Philips web site with that modification (still talk about 0xff00), but we are already in touch with them.

Thanks a lot again,

Andy Ayre

Thanks Graham - I'll double-check our IAP library. I wasn't aware of the change.

Embedded Systems Academy, Inc.
support at esacademy dot com