View previous topic :: View next topic |
Author |
Message |
RobS
Joined: 29 Jan 2005 Posts: 10
|
bootloader and configuration data changes |
Posted: Wed Aug 09, 2006 9:13 am |
|
|
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
|
bootloader... |
Posted: Wed Aug 09, 2006 11:21 am |
|
|
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
|
|
Posted: Wed Aug 09, 2006 1:53 pm |
|
|
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
|
|
Posted: Wed Aug 09, 2006 3:51 pm |
|
|
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. |
|
|
|