paparazzi/luftboot — pull request #3 by scdwyer (2012-10-21 20:50:30+00:00)
Title: changed behaviour of luftboot to better match LPC21xx bootloader

* thanks to @softsr (sergey krukowski) for starting the work
* after payload upload, set flag and reset device
* on boot, if upload just occurred, clear flag and jump to payload
* if payload forced bootloader, start bootloader
* if skip bootloader pin grounded, jump to payload
* if USB vbus powered, start bootloader
* otherwise, jump to payload

Either the external clock (12MHz PLL to 72MHz) or internal oscillator
(8MHz PLL to 48MHz) can be selected at build time. See README.

@softsr, after some consideration, I think your method of setting a flag to allow a full reset is a better solution. I added several features and a few extra comments. Regarding the clock selection, really the external clock should be more stable and reliable, especially for timing sensitive USB operation. However, one can now select internal vs external clock at build time (the default is still external). Any thoughts?

@esden, could you take a quick look?