|
|
View previous topic :: View next topic |
Author |
Message |
ljunior
Joined: 26 Apr 2011 Posts: 4 Location: Brazil
|
HID Bootloader + CDC |
Posted: Tue Apr 26, 2011 5:53 am |
|
|
Hi,
I developed a board using Microchip HID Bootloader and now I'm trying to implement a CDC in this board using CCS CDC example. The CDC code is working right.
The problem I had is that the computer recognize the CDC device but I can't communicate. I just tried an echo code.
Is it possible to implement a CDC over the Microchip HID Bootloader?
Thanks |
|
|
fkl
Joined: 20 Nov 2010 Posts: 44
|
Re: HID Bootloader + CDC |
Posted: Sat May 25, 2013 11:08 pm |
|
|
ljunior wrote: |
Is it possible to implement a CDC over the Microchip HID Bootloader?
Thanks |
Hi.
Did you solve this problem? I'm having the same.
Help... |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Sun May 26, 2013 5:13 am |
|
|
PIC101
1) which PIC
2) which compiler
3) which version of compiler
4) from what you've said(CDC working) then your PC understood the PIC code fine(PIC OK, wiring,PC software)....so your bootloader code is faulty(not loading the CDC program correctly or once the PIC is rebooted,fails to run correctly)
I'd examine the burned PIC to check the CDC pgm code and compare to your known good,running CDC code.Easy to do ,just read the PIC,save the code,twice, then open both files and see what's different.
hth
jay |
|
|
fkl
Joined: 20 Nov 2010 Posts: 44
|
|
Posted: Sun May 26, 2013 10:35 am |
|
|
temtronic wrote: | PIC101
1) which PIC
|
pic18f14k50
temtronic wrote: |
2) which compiler
3) which version of compiler
|
CCS C 4.140
temtronic wrote: |
4) from what you've said(CDC working) then your PC understood the PIC code fine(PIC OK, wiring,PC software)....so your bootloader code is faulty(not loading the CDC program correctly or once the PIC is rebooted,fails to run correctly)
I'd examine the burned PIC to check the CDC pgm code and compare to your known good,running CDC code.Easy to do ,just read the PIC,save the code,twice, then open both files and see what's different.
hth
jay |
If program FW (without Microchip HID Bootloader) with pickit2 - it works!
If program FW (with Microchip HID Bootloader) - CDC is defined in the computer, but can not receive or send bytes. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19546
|
|
Posted: Sun May 26, 2013 11:18 am |
|
|
One thing. Remember that the bootloader, will not program the fuse settings. It can't, since they need to be 'right for it' for it to work.
If your fuses in the CDC, do not match those used in the bootloader, the clock rate being selected may not be the same, and then then the code won't run once loaded with the booloader.
Load the bootloader into MPLAB, and check what it's fuse settings are.
Then change those in the CDC to match, and if necessary change the [spam] statement to match, and recompile.
Also (obviously), the CDC needs to be compiled to load with it's load address set to match what the bootloader expects. #build. A version built to load and run from a programmer, won't run if loaded with a bootloader.
Best Wishes |
|
|
fkl
Joined: 20 Nov 2010 Posts: 44
|
|
Posted: Sun May 26, 2013 12:05 pm |
|
|
Ttelmah wrote: | One thing. Remember that the bootloader, will not program the fuse settings. It can't, since they need to be 'right for it' for it to work.
If your fuses in the CDC, do not match those used in the bootloader, the clock rate being selected may not be the same, and then then the code won't run once loaded with the booloader.
Load the bootloader into MPLAB, and check what it's fuse settings are.
Then change those in the CDC to match, and if necessary change the [spam] statement to match, and recompile.
|
I already tested it (I should have said to you about it before)!
Ttelmah wrote: | Also (obviously), the CDC needs to be compiled to load with it's load address set to match what the bootloader expects. #build. A version built to load and run from a programmer, won't run if loaded with a bootloader.
Best Wishes |
Not absolutely understood "#build", in the main program added the following code:
https://www.ccsinfo.com/forum/viewtopic.php?t=36721&highlight=loadersize
Code: | #build(reset=APPLICATION_START, interrupt=APPLICATION_ISR) |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|