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

USB Bootloader Questions

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



Joined: 16 Sep 2005
Posts: 4

View user's profile Send private message

USB Bootloader Questions
PostPosted: Mon Oct 03, 2005 11:55 am     Reply with quote

I am currently modifying the Codeloader bootloader to work with the CCS CDC USB framework.
I have managed to get it up and running but still need to map the applications interrupt.

My question is however, How can I access the CDC functions like usb_cdc_putc() and usb_cdc_getc() or usb_init(), etc that are already compiled with the bootloader and already present on the microcontroller from my application software without having to re-include the CDC framework with my application as well. This would put two versions of the same code on the PIC, which would really waste alot of space.

Any suggestions would be grealty appreciated as this really simplifies my bootloading process as I can load my applications hex file from hyperterminal just as if I was implementing an RS232 bootloader.

Thanks in advance,
Paul Leslie
pleslie



Joined: 16 Sep 2005
Posts: 4

View user's profile Send private message

PostPosted: Mon Oct 03, 2005 12:02 pm     Reply with quote

I forgot to mention that Im using a PIC18f4550 and CCS version 3.227,

Paul
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

Re: USB Bootloader Questions
PostPosted: Mon Oct 03, 2005 1:41 pm     Reply with quote

pleslie wrote:
I am currently modifying the Codeloader bootloader to work with the CCS CDC USB framework.
I have managed to get it up and running but still need to map the applications interrupt.

My question is however, How can I access the CDC functions like usb_cdc_putc() and usb_cdc_getc() or usb_init(), etc that are already compiled with the bootloader and already present on the microcontroller from my application software without having to re-include the CDC framework with my application as well. This would put two versions of the same code on the PIC, which would really waste alot of space.

Any suggestions would be grealty appreciated as this really simplifies my bootloading process as I can load my applications hex file from hyperterminal just as if I was implementing an RS232 bootloader.

Thanks in advance,
Paul Leslie


The best way would be to include the bootloader code with your application. It doesn't cost you anything since the loader is already occupying space. Another option would be to locate the functions at specific addresses. In your application code, put dummy stub functions there.
pleslie



Joined: 16 Sep 2005
Posts: 4

View user's profile Send private message

PostPosted: Mon Oct 03, 2005 2:16 pm     Reply with quote

Thats a good idea, and kinda along the lines I was thinking. A dummy function with Goto, but how would I deal with the getc() and putc() functions where I need to pass and recieve characters. I would really like the bootloader to remian in the PIC as a standalone piece of code that cannot be modified. Thank you for your quick response,
Paul Leslie
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Oct 03, 2005 2:58 pm     Reply with quote

I don't like "magic" code that I cannot see. getc() and putc() falls into this category. I would write my own functions (there is not much to a getc and putc function). These are part of the loader code. I would always have the loader code in my application. The functions would then be available to the application. There is no draw back to this if you aren't changing the loader. And if you are, then there must have been a problem in the old one any ways.
Guest








PostPosted: Wed Oct 05, 2005 1:07 pm     Reply with quote

The code isn't really magic if it lies resident on the PIC. You can easy see where the functions are located with the bootloader. I dont want to include the bootloader with the application because this would allow a possible corruption of the loader as it must overwrite itself. This would not work well as i will be putting this on a 44pin QFN package with no ablillity to program it with and ICD2 etc. I wrote the dummy stub functions in my application and org'ed them to the right locations. I cannot however get the usb_cdc_putc() and usb_cdc_getc() functions to work. Since these functions use the usb cdc firmware it is not trivial to write these functions without the framework included in the app. Any suggestions would be appreciated as I have the loader working now but just need the abillity to put and receive characters from hyperterminals virtual comm port in my application.
Thanks again,
Paul Leslie[/code]
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Wed Oct 05, 2005 6:24 pm     Reply with quote

"Magic" code that I am referring to are built in functions that CCS provides. The code is not "included" and therefore cannot be located you a users desired location.

Quote:
I dont want to include the bootloader with the application because this would allow a possible corruption of the loader as it must overwrite itself.


Not true if you bootloader protects itself by not allowing its location to be overwritten!
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