The C18 compiler only supports PIC18 based targets, and therefore, this section is only relevant for PIC18 devices. For PIC16 or PIC18 targets using the XC8 compiler, see the XC8 Compiler section.
The PIC18F HID bootloader firmware is compatible with both the C18 and XC8 compilers. When the firmware is build with the C18 compiler, the bootloader project needs to be built with the all of the compiler optimizations full enabled, and using the Default Storage Class “Static”. Using a free/unlicensed version of the compiler will not directly work, as some of the compiler optimizations are disabled in the free version.
If the firmware project is built without the full compiler optimizations enabled, the total code size will be too large to fit within the program memory range 0x000-0xFFF reserved by default for the bootloader firmware. It is possible, albeit not preferred, to move the bootloader/application program memory space boundary, so as to allocate/reserve more flash memory for the bootloader, if the bootloader will be built without full compiler optimizations enabled. See “Moving the Application/Bootloader Flash Boundary”.
The bootloader project is provided with the modified linker scripts to be used with the bootloader project (ex: BootModified.18f14k50_g.lkr), and modified example linker scripts that can be used with the application projects (ex: Linker files for applications\ rm18f14k50_g.lkr). However, certain application projects may require a slightly modified application linker script (ex: projects using large RAM buffers > 256 bytes in size for instance), but the provided application linker files should still be used as a template/starting point when configuring the linker script.
MLA - USB Library Help Version : 2.16
![]() |