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 (although our bootloader doesn't actually
reside there). 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.
Version 1.4 released
Updated main.c code to match the HID bootloader code
contained in MAL USB v2.7
Switched to XT mode from HS for the crystal drive strength -
should help with startup of clock if you're having trouble
Version 1.5 released 11/22/2011
No actual code changes, other than re-structuring how the
SoftwareKey variable is handled due to strange behavior in C32
v2.01
Created a single project folder that holds both MPLAB 8 and
MPLAB X (beta 7.12) projects
Built with C32 v2.01 and Microchip Application Library USB
stack 2.9a (from MAL v2011-07-14)
Included the latest PC software - HIDBootloader.exe v2.90a -
in the project folder
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 any of these three conditions:
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 HIDBootLoader.exe program on your PC
(which is contained in the zip file below), 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.5 Files:
ZIP file of all project and source files
necessary
to build 1.5 here.
PIC32MX460 v1.5 HEX
here
(for
programming a
blank UBW32 - old style)
PIC32MX795 v1.5 HEX here
(for programming a blank UBW32 - new style)
Browse the v1.5 build files here HIDBootloader
application
v2.90a (also contained in the zip file above)