For all people who want to change the bootloader supported crystal frequency :

The source code is

here.

Take a look at config.h and change the DEVCFG2 bits.

Take care there are 2 definitions, one if you compile the code with MPLAB, the second if you use the Pinguino GCC Toolchain.

Note1 : PLL must be 4MHz so make sure your Crystal frequency / FPLLIDIV = 4MHz.

Note2 : 32MHz crystal implies FPLLDIV = DIV_8 which DOES NOT EXIST, values available are :

DEVCFG2: DEVICE CONFIGURATION WORD 2

bit 2-0 FPLLIDIV<2:0>: PLL Input Divider bits

111 = 12x divider

110 = 10x divider

101 = 6x divider

100 = 5x divider

011 = 4x divider

010 = 3x divider

001 = 2x divider

000 = 1x divider

So valid crystal frequencies (to use the USB HID Bootloader) are :

111 = 12x divider => 48MHz

110 = 10x divider => 40MHz

101 = 6x divider => 24Mhz

100 = 5x divider => 20MHz

011 = 4x divider => 16MHz

010 = 3x divider => 12MHz

001 = 2x divider => 8MHz

000 = 1x divider => 4MHz