# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MLA -- USB Library

20 December, 2013

- 1
- 2
…
- 255
- 256
- 257
- 258
- 259
…
- 311
- 312

NOTE: Once the above changes are made to the application project, the output .hex file will no longer work when
programmed stand alone, but it will be programmable by the HID bootloader firmware. This can make further application
development less convenient, until the bootloader and application project output is “merged” using the procedures
described in the Merging Bootloader and Application Project Output section.
1.6.3.2.3.1.6 Merging Bootloader and Application Project Output
Discusses how to generate a single .hex file that contains both the boot loader and the application project output.
Description
To “merge” the two projects together (so that the application firmware .hex file is not required to be programmed by the
bootloader, but may be programmed either stand alone via ICSP or by the bootloader), the following can be done:
1. Open and build the HID bootloader firmware project in the MPLAB X IDE.
2. Open the application firmware project in the MPLAB X IDE.
3. Add the “MPLAB.X.production.hex” file (generated by the HID bootloader firmware project) to the application firmware
project as a “Loadable” file in MPLAB X. This can be done from the project view window and right clicking on the
“Loadables” folder, and selecting the “Add Loadable File…” option.
4. Build the application firmware project. After the project builds, MPLAB X will automatically run the “HEXMATE” utility in
the background and generate a merged .hex file (which will contain both the bootloader firmware and application
firmware). This merged .hex file can be programmed either stand alone with an ICSP™ programmer or using the
bootloader.
If step number 4 above fails, this implies that there are overlapping but non-equivalent sections of the program memory
values in the two hex files (from the HID bootloader firmware and the application project). Normally, this error will be caused
by having slightly different configuration bit settings between the application firmware project and the HID bootloader
firmware project. To fix this error, you must modify the two projects so that the configuration bits are 100% identical between
the two or are only implemented in one of the firmware projects.
1.6.3.2.3.2 PIC24F
This section covers the PIC24F product line USB boot loaders.
Description
This section covers the PIC24F product line USB boot loaders.
1.6.3.2.3.2.1 Adding a boot loader to your project
This section covers how to add a boot loader to your application.
Description
The boot loader implementations available in the USB Library take a two application approach. What this means is that the
boot loader and the application are development, compiled, and loaded separately.
With this approach there are two separate linker scripts that are required, one for the boot loader, and one for the application.
For the PIC24F applications intended to be used with a boot loader, all that is required is to attach the specific linker file
designed for the applications of that boot loader to the project.
• No modifications are required to the linker file. Just attach the provided application linker file to the application project
without modification.
• No modifications are required to the application code. Just write your code as you always would and attach the provided
application linker file to the application project without modification.
The required application linker files are found in the folders that contain the targeted boot loaders. These linker files can be
1.6 Demos MLA - USB Library Help Device - Boot Loader - HID
257

- 1
- 2
…
- 255
- 256
- 257
- 258
- 259
…
- 311
- 312