Installing Imote2 Bootloader, using the TinyOS Bootloader

This technique exploits a desgin error in the TinyOS bootloader. The TinyOS bootloader cannot prevent itself to be overwritten by an application, and this is used here.

NOTE: there is no way to overwrite our bootloader, indeed it is not able to update itself (yet). Thus you should have JTAG hardware and you should know how to flash a bootloader using JTAG. The feature of installing our bootloader using the TinyOS bootloader was more a proof of concept and since you have to use JTAG at the end of the day, you should consider using JTAG from the beginning.

Nevertheless, you can install our bootloader by just uploading the bootloader binary as you use to upload all your other programs (using USBHostLoader). Our bootloader will start as a normal application but installs itself as the new bootloader.