Hello
I Have developed a small simple set of functions to use the IAP services. All the IAP functions work as long as I do not start the OS. Once I start the OS All functions work except for erase. The erase actually happens but the call does not return properly. When I stop the cpu it is sometimes in the Dabt vector. I can step or run over all other functions except erase. I am using IDISABLE and IENABLE around the call. Using latest library and IDE. Has anyone heard of such a problem ?
David
Stack - Had enough RAM - Had enough Timing - was in kHz
But I got it working at least for the time being. I ended up doing this.........
//read enabled interrupts ihold = VICIntEnable;
//clear the enabled bits VICIntEnClr = ihold;
//enter boot rom iap_entry (command, result);
//restore interrupts after return VICIntEnable = ihold;
Seems timer0 was still interrupt enabled. I did read somewhere that just disabling main interupts doesn't stop them from happening, and that they need to be disabled in the vic. Is something like this done in the Keil FlashFS that we can't see ? Maybe this should be added to docs for NXP LPC internal flash use.
Thanks for the moral support !
Hi Michael,
Glad to hear you got it working.
It shouldn't be neccessary (but also shouldn't cause any harm) to disable the interrupt sources at the VIC.
When I use the IAP functions, I just make sure that IRQ & FIQ are masked (and restored afterwards !). This has worked for me without problems. I'm not using an OS, but that really shouldn't be a factor (unless, of course, the OS has some critical timing requirements that can't be met while the IAP functions are running).
Disabling IRQ & FIQ doesn't stop the interrupt sources signalling - it just stops them from getting through to the CPU. Depending on how your interrupt system is configured, any pending interrupts may be called as soon as you re-enable IRQ & FIQ.
Out of interest, which OS are you using ?
I'm using the KEIL RL-RTX. It looks alot like from what i remember as CMX's RTXC along time ago.
Thanks again