CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

HID Bootloader + CDC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ljunior



Joined: 26 Apr 2011
Posts: 4
Location: Brazil

View user's profile Send private message

HID Bootloader + CDC
PostPosted: Tue Apr 26, 2011 5:53 am     Reply with quote

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

View user's profile Send private message

Re: HID Bootloader + CDC
PostPosted: Sat May 25, 2013 11:08 pm     Reply with quote

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: 9226
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun May 26, 2013 5:13 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun May 26, 2013 10:35 am     Reply with quote

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: 19513

View user's profile Send private message

PostPosted: Sun May 26, 2013 11:18 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun May 26, 2013 12:05 pm     Reply with quote

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)
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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