Answers interspersed -Bill On Fri, 08 Apr 2005 13:35:28 +1000, Bruce Paterson wrote: Bill Knight wrote: > I just uploaded a set of LPC flash programming routines to the files area > on Yahoo. They were written for gcc and support both ARM and Thumb modes > of operation. Hopefully, they will prove useful to the group. Bill, Just been having a look at your routines as I need to do some IAP now myself. I have a few questions to you/the group if you don't mind: 1/ I notice you expect CMD_SUCCESS, never BUSY back from calling iap. This implies to me the iap routines always execute to completion before returning (this conficts with another posting to this group which showed a for(;;) loop waiting for non-BUSY return). Confused ! *** The code simply returns the result whenever it is not CMD_SUCCESS or when done. A test for BUSY could be added to flashWrite() with a limit to the number of tries. So far, I have not found this to be a problem but YMMV. 2/ If the iap routines don't return till all is done, what happens to the watchdog ? The watchdog cannot be disabled once started, so do a) the iap routines feed the watchdog internally (philips question) ? b) we need to reboot with watchdog disabled in order to do IAP ? *** I'll leave the answer for this one to the Philis Apps guys. 3/ I notice you prepare all sectors for write every interation of your writing loop. Is this just for easier coding ? *** Caught me. Because the translation from address to sector number is different between various LPC parts, I chose to do it the simple way. 4/ In what cases would memmap be anything other than user code in practice ? (I notice you save and restore). *** Not exactly. The interrupt vectors could have been remapped to RAM. -- Cheers, Bruce
Message
Re: [lpc2000] Questions on LPC Flash Programming Routines
2005-04-08 by Bill Knight
Attachments
- No local attachments were found for this message.