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

tcp bootloader
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

PostPosted: Tue Feb 05, 2013 2:46 am     Reply with quote

Looks like my lexdyxia is'nt cured yet !

The advantage, all be it a minor one, is with a high memeory bootloader the app does'nt need to modified and re-compiled when switching between using a PICKIT, ICD or other programmer and using the bootloader. i.e. You might have a dev system on your desk with ICD attached and targets in the field with bootloaders. Both should run the same hex file.
jeremiah



Joined: 20 Jul 2010
Posts: 1426

View user's profile Send private message

Re: ex_usb_bootloader
PostPosted: Tue Feb 05, 2013 9:20 am     Reply with quote

What modifications are needed in that scenario for a low memory bootloader?

nurquhar wrote:

Personally I prefer the approach of the bootloader being in the top of memory so the app can be used as normal starting at 0x0000. The only wrinkle to be handled by the bootloader is to catch the writing of the apps reset vector at 0x0000 and store it elsewhere. i.e. The reset vector points directly to the start of bootloader which chains to the app using the vector it caught and stored.


You can actually set a different app reset vector in the app code using the #build directive (as well as interrupts if you wish to move those, but that actually requires a remapping in the bootloader as well). Then it won't try to write it to 0x0000.
nurquhar



Joined: 05 Aug 2006
Posts: 149
Location: Redditch, UK

View user's profile Send private message Visit poster's website

PostPosted: Wed Feb 06, 2013 12:02 pm     Reply with quote

Ok I have it working Very Happy . ie modified ex_usb_bootloader to load applications at there natural position in low memory. Bootloader is now in high memory. No need to alter your app in any way to use the bootloader, other than it needs to fit the space available.

I have made some other improvements/changes :
1) Changed it use polled usb task which gets rid of the need for interrupt redirection.
2) Turned off Xon/Xoff, seems work without. I will have to check a big program to be sure.
3) Why send 0x06 after each hex line? Changed it to give '+' for a line which passes the CRC check, '~' for failed.
4) Allowed echo of hex file comment lines.
5) Added simple command line i/f. ie two commands "load" and "run".

So output on terminal to load and run an app looks like :
Code:
Monitor 06-Feb-13 17:42:07
>
>
>load
Waiting for Hex File Upload
+++++++++++++++++++++++++++++++++++++++++++++++++++
;PIC18F27J53
;CRC=8774  CREATED="06-Feb-13 14:14"
Upload OK
>
>run
Starting...


I would love to share the code but the moderators might jump on me for posting CCS examples. All be it heavily modified.
Ttelmah



Joined: 11 Mar 2010
Posts: 20161

View user's profile Send private message

PostPosted: Wed Feb 06, 2013 12:25 pm     Reply with quote

06, is ASCII 'acknowledge'.
Use 06, and 21 (0x15 is ASCII 'negative acknowledge).
These are historical standard communication characters.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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