• AVR Freaks

Hot!USB HID Bootloader not loading application correctly

Author
tgroschup
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2020/07/27 02:33:06
  • Location: 0
  • Status: offline
2020/07/30 01:13:17 (permalink)
0

USB HID Bootloader not loading application correctly

Hello,

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!
#1

2 Replies Related Threads

    Pusb
    Senior Member
    • Total Posts : 107
    • Reward points : 0
    • Joined: 2004/02/09 09:47:27
    • Status: offline
    Re: USB HID Bootloader not loading application correctly 2020/08/25 22:58:45 (permalink)
    0
    which XC16 version?
    #2
    tgroschup
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2020/07/27 02:33:06
    • Location: 0
    • Status: offline
    Re: USB HID Bootloader not loading application correctly 2020/08/28 00:09:51 (permalink)
    0
    XC16 is at version 1.35.
    #3
    Jump to:
    © 2020 APG vNext Commercial Version 4.5