Description:
The bootloader is a small application that is programmed into your
UBW32. There is a special 12K of Flash space reserved in the PIC32 for
bootloader applications. The bootloader application runs whenever the
UBW32 is reset, and decides if it should go into 'bootload' mode or
'run firmware' mode. The HIDBootloader.exe application allows you to
program your UBW32 using just your computer and a USB cable - no
hardware programmer is required. This allows you to easily write new
firmware or change the stock firmware and add your own commands.
Version Notes:
Version 1.0
Version published by Microchip
Version 1.1
Converted HID Bootloader project to UBW32 hardware
Changed button/LED I/O and added software key (for BL command)
Sent to SparkFun for programming onto UBW32s
Version 1.2
Fixed bug in boot_software_key_sec so it works properly all the
time
Version 1.3 released 9/07/09
Edited project files to use new version of Microchip USB stack,
version 2.5b. No new functionality, other than the bug fixes present in
the new USB stack.
NOTE: This version causes the BL command to break when used
with the origional bootloader (shipped on UBW32s as of fall 2009). Use
latest bootloader or go back to version 1.2 to regain BL command.
Bootloader Operation:
You can use your UBW32 in one of two ways - with bootloader or without.
This page only describes using it with the bootloader, as that is how
it is shipped from SparkFun.
When your UBW32 resets, it starts running the bootloader code. This
bootloader code checks for one of three things:
PRG button held down
Software Key has correct value
Rest of FLASH is blank (erased)
If any one of these three things is true, it will turn on all five LEDs
and alternate flashing the white and green ones, then jump into
bootloader mode. If none of them are true, then it jumps to the
beginning of the normal firmware, and starts executing it as if nothing
happened.
In bootloader mode, the HID Bootloader will activate the USB port on
the UBW32 and will enumerate with your computer as a generic HID
device. (Which means no drivers will ever be needed on the PC side.) It
then waits for commands from the computer. Once you have your UBW32 in
bootloader mode, you run the HIDBootload.exe program on your PC, and
then you can send a new HEX file down to the UBW32 and have the
bootloader program that HEX file into flash. Once you're done
programming, you can either reset the UBW32 manually (pressing and
releasing the RESET button) or click the Reset Device button in
HIDBootloader.exe and the UBW32 will then reboot and run the new
firmware you just programmed.
Version 1.3 Files:
ZIP file of all project and source files necessary
to build 1.3 here.
v1.3 HEX
here (for
programming a
blank UBW32)
Browse the v1.3 build files here HIDBootloader
application v2.3 (also contained in the zip file above)