• AVR Freaks

Hot!USB application and USB bootloader

Author
rahultgeorge91
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/06/25 03:53:59
  • Location: 0
  • Status: offline
2019/06/27 05:03:08 (permalink)
0

USB application and USB bootloader

Hi all, I am trying to build a USB bootloader for my USB HID device. The USB HID device is working individually and the bootloader is also working separately (meaning. If I try to bootload a program which doesn't use usb, the bootloader works, tested with a simple LED program)

The bootloader is taken from MLA example and modified to suit the device and the board I have.

Once I program the device with the usb hid program, the next time I connect the device to PC, device is recognised as unknown device.

PIC IC: PIC18LF45K50
MPLAB VERSION: 5.10

Any suggestions as to what might be wrong ? I have checked and ensured the OSCILLATOR settings on both devices are same and the CONFIG bits are also matching.

If anyone has faced similar troubles and found a solution, it would be helpful..
#1

5 Replies Related Threads

    rahultgeorge91
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2019/06/25 03:53:59
    • Location: 0
    • Status: offline
    Re: USB application and USB bootloader 2019/06/27 23:57:01 (permalink)
    0
    Debug update:

    I programmed the uC as a USB HID device and it is working as expected if I don't give any memory offsets. But if I give the offset as 0x2000 and the program range as 'default,-0x0000-0x1FFF' the devices stops working as a usb device.

    For another debug, I gave the start memory offset to be 0x800, just outside of boot block and device is not recognised as a USB device.

    This is not correct, or am I missing something in between ?
    post edited by rahultgeorge91 - 2019/06/28 02:26:12
    #2
    ric
    Super Member
    • Total Posts : 23243
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: USB application and USB bootloader 2019/06/28 03:04:07 (permalink)
    +1 (1)
    Once you specify an offset, it won't run without the bootloader present to get it started.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #3
    rahultgeorge91
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2019/06/25 03:53:59
    • Location: 0
    • Status: offline
    Re: USB application and USB bootloader 2019/06/28 03:53:16 (permalink)
    0
    Agreed and confirmed this. 
    So the debug I am doing was wrong.. 
     
    Also I have compiled the Booloader in the Standard mode and is a 4.16KB bootloader. 
    Still the problem persists, the USB application is not getting recognized/enumerated if I have a bootloader in the beginning. 
    post edited by rahultgeorge91 - 2019/06/28 06:52:41
    #4
    rahultgeorge91
    New Member
    • Total Posts : 4
    • Reward points : 0
    • Joined: 2019/06/25 03:53:59
    • Location: 0
    • Status: offline
    Re: USB application and USB bootloader 2019/07/01 08:11:22 (permalink)
    +3 (3)
    Debug update: 
     
    So after hours of debug, datasheets and pulling out my hair. Understood that I forgot to remap the High and Low ISR. remapped them and both bootloader and Application are working perfectly. 
     
    Thanks!!
    #5
    kjo
    Starting Member
    • Total Posts : 80
    • Reward points : 0
    • Joined: 2006/07/11 15:11:02
    • Location: 0
    • Status: offline
    Re: USB application and USB bootloader 2019/07/10 19:41:29 (permalink)
    0
    USB bootloader applications are challenging. Congratulations for getting it working. Please take the time to give the forum some greater details on what your problem was and how you fixed it. There is always someone else who can learn from your efforts.
    #6
    Jump to:
    © 2019 APG vNext Commercial Version 4.5