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 support@ccsinfo.com

bootloader and configuration data changes

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



Joined: 29 Jan 2005
Posts: 10

View user's profile Send private message

bootloader and configuration data changes
PostPosted: Wed Aug 09, 2006 9:13 am     Reply with quote

I’m using a PIC 18LF8720. CCS Ver 3.236.

I’ve implemented a bootloader that imports a new hex file and replaces the contents of program memory except for the loader section. It has two steps. The 1st receives a file over the serial port from the host and places it in upper program memory then sets a flag in flash EE if successful. The 2nd step checks the flag and if set copies the section in upper memory to lower memory, except for the loader part. Commands from the host initiate both steps.

While the above is great I just determined the configuration data starting at address 0x300000, set by the fuses, is not part of the file that gets imported in.

I’m looking for recommendations on how to deal with changes in the configuration data.
Thanks
ktallevi



Joined: 17 Dec 2005
Posts: 58

View user's profile Send private message

bootloader...
PostPosted: Wed Aug 09, 2006 11:21 am     Reply with quote

The configuration data should be at the bottom of the hex file.


:020000040030CA // this line changes the high bytes of the data address

:0E00000000421F0EF1878000FF80FFE0FF40EE // this is your data packet

:00000001FF // end of file
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Wed Aug 09, 2006 1:53 pm     Reply with quote

You can change config data from inside a bootloader ? I didn't know that.

I thought it had to be done at program time. Or is that just certain fuses ?

It would be kinda dumb if you could change code protect from on to off.... But then again, if you have the bootloader you have most of the code anyway.

I'm suprised more people are not interested in encrypted bootloaders.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Aug 09, 2006 3:51 pm     Reply with quote

iso9001 wrote:
You can change config data from inside a bootloader ? I didn't know that.

I thought it had to be done at program time. Or is that just certain fuses ?
I haven't tried it, but as far as I understand you can set and reset most configuration bits from within your program. If you want to disable this feature then set the Configuration Write Protection bit (WRTC). Note that in user mode WRTC is a read only bit, it can only be programmed using an external programmer or ICSP.

Quote:
I'm suprised more people are not interested in encrypted bootloaders.
In this forum some simple but effective encryption algorithms have been discussed. I for my part don't care that much. Anybody smart enough to study the PIC assembly code of my programs can create a similar application in less time. Ofcourse there will be situations where encryption is important, but for most applications it is only adding complexity.
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