I'm using MPLAB X IDE v6.20 with XC8 v2.48. I do not have a compiler license so I cannot compile with -Os.
I tried compiling the bootloader for the Pololu P-Star PIC18F25K50. It does not fit in 8K.
I can program the pre-compiled hex file - USB_uC_X5K50_P_STAR.hex - and that works.
However, I wanted to be able to compile my own binary and the compilation is too large by approximately 120 bytes.
After looking at the code, I re-wrote the routine parse_hex in bootloader.c and the compilation now fits in 8K (approx. 8177 bytes).
My changes are shown with #if 0/1 in bootloader.c in case anyone else is interested in getting the bootloader to build with the standard MPLAB X IDE.
bootloader_c.zip
I'm using MPLAB X IDE v6.20 with XC8 v2.48. I do not have a compiler license so I cannot compile with -Os. I tried compiling the bootloader for the Pololu P-Star PIC18F25K50. It does not fit in 8K. I can program the pre-compiled hex file - USB_uC_X5K50_P_STAR.hex - and that works. However, I wanted to be able to compile my own binary and the compilation is too large by approximately 120 bytes. After looking at the code, I re-wrote the routine parse_hex in bootloader.c and the compilation now fits in 8K (approx. 8177 bytes). My changes are shown with #if 0/1 in bootloader.c in case anyone else is interested in getting the bootloader to build with the standard MPLAB X IDE. bootloader_c.zip