LPC2129 IAP problem solved, sorta.
2005-03-18 by yamppman
After about a year on Prozac and Valium since my last encounter with the Philips LPC series, I'm on it again, using it in a new project. And I need to use the IAP functionality ofcourse. And after spending several hours trying all kinds of variants on the apparently non-working IAP sample code from Keil and ripping out most of my remaing hair, I thought I'd share some info. According to the user manual, and the Keil example, the erase and write calls require the processor clock frequency in a parameter, presumably to time the flash functions. What's NOT mentioned is that it does not work if you're running the CPU at "normal" speed, 60 MHz. The code would end up all over the place - in the Abort or Undef handler or way off at memory position 0x800xxxx. Also, the Setup for Erase/Write calls would take 50-100 mS to complete. As soon as I dropped the cclk to 12 MHz by disabling the PLL, everything worked immediately. And the calls returned much faster. So, it just proof the old classic, never trust a Philips Datasheet ! /Jesper