USB HID Bootloader not loading application correctly
I am trying to run a USB HID device bootloader on a PIC24FJ1024FB610 on an Explorer16/32 board with MPLabX 5.40. The USB device bootloader is the example taken from MLA 2017_03_06.
The program running on the host and flashing the application is mphidflash (https://github.com/AdamLaurie/mphidflash).
My application is just a main function turning on one LED. I added the linker script provided with the bootloader, config bits are the same for the bootloader and application.
After building the bootloader the hex file for the bootloader shows its occupying program memory up to 0x1908, the application starts much later at 0x2000.
The application alone (compiled also with the linker script) runs fine: the LED lights up.
But after programming the application with the host program and bootloader I see that the bootloader jumps to the application code (program counter jumps to reset vector of application). But the LED does not light up.
There is one way to get that small application to work: Define the default interrupt. As soon as there is a default interrupt defined, I see the LED turning on after starting the bootloader. Never mind that neither the bootloader nor the application use interrupts.
Sadly this trick does not work with a more complex example, like the Explorer16/32 demo (http://ww1.microchip.com/..._demo_2019_06_07.zip).
I am a bit at a loss here how to proceed. How can I make the bootloader load my app correctly?
Thanks in advance and best regards!