Microchip USB HID Bootloader v2.2, working???


Closed Thread
Results 1 to 7 of 7
  1. #1

    Question Microchip USB HID Bootloader v2.2, working???

    Dear all,

    I'm confused because that v2.2 of the bootloader seems to work correctly, however the outcome is null/zero/nothing. This is how it goes: When you first open v2.2 and there you then open a hex file and then start programming it by pressing "Program/Verify", it starts and it tells you:

    Erase Started (it might take several seconds)
    Programming Complete
    Verify Running
    Erase/Program/Verify Completed Successfully

    One could interpret that: first erase, then program, then verify and to the last thing tell the user that the operation has been successful.

    That looks good, however, if you now moves your PIC (4550) from the testing board to your programmer and read what is in your PIC you will find out that there is just the bootloader but not your code you wanted to test.

    Is v2.2 fooling you?

    Has this happened to anyone else?
    Do I do something wrong?
    Am I blind to something here?
    What can be wrong?

    If you have any idea what this could indicate, please let me know.

    Please help.

  2. #2
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    No problems here with the HID bootloader.

    I did have some issues with fuses early on, but after that it all worked well.

    Do you have the DEFINE use_loader 1 and DEFINE ORG $0800 in your code to hop over the bootloader ??

    Did you recompile the source code or just use the .HEX file from Microchip ?
    If you use the Verify button in the GUI does it pass ?
    Try manually doing the ERASE, Program and Verify cycle.

    I just use the Program option and it just seems to work - mind you I have never tried reading it back. From looking at the bootloader source I think it might code protect the boot code and this might stop your programmer reading all the memory - let me go out to the shed and see if I can read a programmed chip and see what I get...

    Bill.

  3. #3
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    Just remembered that you need

    DEFINE ORG $1000

    for the HID bootloader - the define of $0800 is for the other version which is a bit smaller..

    bill.
    Last edited by bcd; - 5th November 2008 at 09:54. Reason: Cannot spell after one beer...

  4. #4

    Default

    Quote Originally Posted by bcd View Post
    No problems here with the HID bootloader.

    I did have some issues with fuses early on, but after that it all worked well.

    Do you have the DEFINE use_loader 1 and DEFINE ORG $0800 in your code to hop over the bootloader ??

    Did you recompile the source code or just use the .HEX file from Microchip ?
    If you use the Verify button in the GUI does it pass ?
    Try manually doing the ERASE, Program and Verify cycle.

    I just use the Program option and it just seems to work - mind you I have never tried reading it back. From looking at the bootloader source I think it might code protect the boot code and this might stop your programmer reading all the memory - let me go out to the shed and see if I can read a programmed chip and see what I get...

    Bill.
    Thanks Bill

    I do have DEFINE LOADER_USED 1, however I do not have DEFINE ORG. This is because I read somewhere that PICbasic will relocate your code after the bootloader to $1000. The size of the bootloader seems to be $fe6, so it is just under 1000. I tried DEFINE ORG $1000, but without success, the compile (PBP v2.50b via Microcode Studio) will produce error 118 if I include DEFINE ORG.
    The testprog in itself does work just perfectly when programmed alone with Melabs U2 programmer.

    I can Erase, Verify and it seems to me that I can do everything with v2.2 and everything seems to work, but only seems to work. It answers to Erase ok, as well as to the Verify.However, there is only the bootloader, not anything else. One can see, with the U2 programmer, meProg and with Read PIC, in the Memory window that there is not more code than $fe6 that is the same amount as the bootloader.
    So what is v2.2, a pathological lier?

    I use the 4550.hex from Microchip, I do not recompile it, because I do not have the C or C++ compiler.

    In a matter of fact the testprog is originally generated by easyHID there is just a few lines more to toggle some legs etc so that you can verify that your PIC is living...

  5. #5
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    Send me through your hex file (both the bootloader and the program) an I'll try them here. Will also need Xtal speed.

    I just had a look and I have these in my program : - looks like I was wrong about the DEFINE command - it should be DEFINE RESET_ORG

    DEFINE OSC 48
    DEFINE LOADER_USED 1
    DEFINE RESET_ORG 1000h ' For Microchip USB Bootloader


    bill.

  6. #6

    Default

    Quote Originally Posted by bcd View Post
    Send me through your hex file (both the bootloader and the program) an I'll try them here. Will also need Xtal speed.

    I just had a look and I have these in my program : - looks like I was wrong about the DEFINE command - it should be DEFINE RESET_ORG

    DEFINE OSC 48
    DEFINE LOADER_USED 1
    DEFINE RESET_ORG 1000h ' For Microchip USB Bootloader


    bill.
    Yesssss

    Of course DEFINE RESET_ORG 1000h
    That was missing... my mistake

    I'm glad, so glad that this was the only fault. Not a big struggle or .....

    Thank you so much Bill, thank you indeed!

  7. #7
    Join Date
    Feb 2003
    Location
    Sydney, Australia
    Posts
    126

    Default

    You're very welcome. Glad it was that simple !

    bill.

Similar Threads

  1. USB Bootloader.
    By HenrikOlsson in forum USB
    Replies: 22
    Last Post: - 2nd May 2013, 03:46
  2. USB hid maker help please.
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2013, 15:49
  3. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 23rd November 2008, 00:51
  4. Replies: 7
    Last Post: - 10th November 2008, 10:24
  5. 18F2550 MCRL/RE3 problem with USB bootloader Microchip
    By Ronald123 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 24th September 2007, 11:48

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts