PDA

View Full Version : Microchip USB HID Bootloader v2.2, working???



keymuu
- 5th November 2008, 00:15
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?:mad:

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.

bcd
- 5th November 2008, 08:47
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.

bcd
- 5th November 2008, 08:53
Just remembered that you need
<code>
DEFINE ORG $1000
</CODE>
for the HID bootloader - the define of $0800 is for the other version which is a bit smaller..

bill.

keymuu
- 5th November 2008, 09:52
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... :p

bcd
- 5th November 2008, 09:59
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
<code>
DEFINE OSC 48
DEFINE LOADER_USED 1
DEFINE RESET_ORG 1000h ' For Microchip USB Bootloader
</code>

bill.

keymuu
- 5th November 2008, 11:14
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
<code>
DEFINE OSC 48
DEFINE LOADER_USED 1
DEFINE RESET_ORG 1000h ' For Microchip USB Bootloader
</code>

bill.

Yesssss :p

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

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

Thank you so much Bill, thank you indeed! :)

bcd
- 5th November 2008, 11:30
You're very welcome. Glad it was that simple ! :)

bill.