Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
• Erase/Program/Verify Device: This is a 3-step operation.
1) It first erases the Flash program memory on the target microcontroller. If “Allow Configuration Word Programming” is
selected, the configuration bits or flash configuration words (depending on the device) will also be erased.
2) It then programs the target microcontroller with the recently selected HEX file.
3) Finally it compares the program image on the target to a HEX file image stored in the host’s buffer to complete verify
operation.
• Reset Device: issues a RESET instruction to the target microcontroller. This is typically done following successful
erase/program/verify operation, so that the application can begin executing the newly reprogrammed firmware image.
The “Program” file menu option has a “Settings…” which contains checkboxes allowing the user to select what type of
program memory regions should be programmed on the erase/program/verify operation. This allows for deselecting
EEPROM from being programmed for example. This also allows for enabling/disabling reprogramming of the configuration
bits (and therefore last page of flash memory on PIC18FxxJxx devices).
NOTE: The SD Card PICtail™ Daughter Board (Microchip Direct: AC164122) uses the RB4 I/O pin for the card detect (CD)
signal when used with the PIC18F87J50 FS USB Demo Board (PIM), and is actively driven by the PICtail. The active drive
overpowers the pull up resistor on the RB4 pushbutton (on the PIC18F87J50 FS USB Demo Board). As a result, if the
PIC18F87J50 is programmed with the HID bootloader, and an SD Card is installed in the socket when the microcontroller
comes out of reset, the firmware will immediately enter the bootloader (irrespective of the RB4 pushbutton state). To exit
the bootloader firmware, remove the SD Card from the SD Card socket, and tap the MCLR button. When the SD Card is
not plugged in, the PICtail will drive the card detect signal (which is connected to RB4) logic high, which will enable the
bootloader to exit to the main application after coming out of reset. Once the main application firmware is operating, the SD
Card can be plugged in. The SD Card is “hot-swappable” and should be recognized by the host upon insertion. To avoid
this inconvenience when using the bootloader with the PICtail, it is suggested to modify the bootloader firmware to use
some other I/O pin for bootloader entry, such as RB0 (which has a pushbutton on it on the HPC Explorer board).
1.6.3.1 Customizing for an Application
This section covers various topics that should be considered when implementing a boot loader. It also discusses possible
changes in behavior from the default behavior that a user might want to implement in their boot loading solution.
Description
1.6.3.1.1 Importance of Change the VID/PID
Discusses why it is critical to change the VID/PID in the example code to one unique to the product being developed.
Description
The USB Vendor ID (VID) and Product ID (PID) are special numbers (16-bits each) that all USB devices implement. These
numbers are especially important for bootloader operation, since they are the primary identifying numbers that a PC
application (such as the HID bootloader host/PC GUI program) needs in order to “find” and connect up to the correct USB
device on the bus (a USB root port can have up to ~127 USB devices attached to it, and some means must be used to “find”
specific products).
When implementing a USB device with a bootloader, it is especially important to change the VID/PID value from the
original/default value as distributed in the example firmware/PC application, to new values that are unique for your
application product line. This is important, to ensure that no unintended host/PC application software can ever unintentionally
connect up to your USB device, and reprogram it with an incorrect/incompatible USB firmware image, designed for some
other manufacturer’s product.
The VID/PID values can be modified in the bootloader firmware project by editing the USB device descriptor in the
usb_descriptors.c file. Once the value has been modified, the host/PC GUI bootloader program that performs the firmware
1.6 Demos MLA - USB Library Help Device - Boot Loader - HID
240
Protego_Release_01_05-Related-OEM-Documentation-MLA_v2013_12_20-help_mla_usb.pdf