|
Page 4 of 4 I have implemented the required functionality and wrapped it up in a DLL so that it is pretty painless to simply use in your application. The complete documentation (MSDN-style) for the Bootloader Interface DLL is available online in HTML format , or as a downloadable compiled help module. From a user's standpoint, that documentation should cover all you need to be able to implement bootloader functionality in an application. The Bootloader Interface class extends my PICUSB class, which in turn wraps around the USB functions provided in Microchip's MPUSBAPI.DLL. Essentially this class is a nice wrapper around all the 'dirty work' of dealing with HEX files and reading/writing/erasing the PIC, providing a number of very easy-to-use methods for all the necessary bootloader tasks. Example Bootloader Application: I originally implemented a simple bootloader application for this project, and while it worked fine, it was lacking some usability, so I have made this one which is a bit fancier, but a lot more usable for day-to-day use. Implementing a really simple version should be pretty straightforward based on the class documentation, if you wish to do so. Download Bootloader Interface Class Code Package Includes C# project for building BootloaderInterface.DLL, as well as the DLL, and the compiled code documentation. Last Updated 3/1/08
Download Bootloader Application Code Package Includes C# project for bootloader app, including required DLL's. Last updated 3/1/08 Download Bootloader Application (executable and required DLL's only) Includes application executable and required DLL's (no code). Last update 3/1/08 The "real" version of the USB bootloader app has a lot more features than the previous, oversimplified one, making it suitable for actual use rather than just as a clunky demo. Time-consuming read/write/erase tasks are done in a separate execution thread to prevent freezing up the GUI, and enough options are added to cover normal use.
This version also includes some support for a modified bootloader firmware done by Rob Edwards, which can be downloaded below. (His firmware has the ability to enter bootload mode on reset based on either the normal button presses, or on a 'flag' value written to a particular EEPROM location, which means your user program can write the value to EEPROM and reset, entering boot mode entirely through software) I've added a button to the bootloader software to send the command 0xFE to the PIC in user mode. This assumes that you've implemented the kind of generic-class device interface that I use in my other tutorials, and that in your user firmware you handle the command 0xFE by writing the value 0xFF to EEPROM location 0xFE (the bootload flag). If you're using a different interface in your user code, this button in the software won't do you any good, but the EEPROM-flag bootloader firmware will still work just fine, you'll just have to code in your own method to order it into boot mode. 
DOWNLOAD ROB EDWARDS' MODIFIED BOOTLOADER FIRMWARE (HEX) (Last updated 3-28-07)
|