View previous topic :: View next topic |
Author |
Message |
ktallevi
Joined: 17 Dec 2005 Posts: 58
|
Setting PIC18F8722 Bootloader size |
Posted: Mon Nov 20, 2006 10:40 am |
|
|
I noticed there is no #fuse to set the bootloader block size. CONFIG4L:BBSIZ bit.
I need to have a bootloader of 8k in size and protected. I see you can protect the bootloader but not set the size via fuses.
anyone have any suggestions? thanks
-kevin |
|
![](templates/subSilver/images/spacer.gif) |
jma_1
Joined: 08 Feb 2005 Posts: 147 Location: Wisconsin
|
|
Posted: Mon Nov 20, 2006 11:16 am |
|
|
Greetings,
If you use the CCS bootloader example, you can set the protected area size. I have not done this, but it appears you could modify LOADER_SIZE to suit your needs.
Why do you need 8k worth of reserved space? Are you trying to put a test application into the boot blocK? Is there enough space left over for your real application? If you are just trying to maintain data, can you use the EEPROM? These are just questions, but perhaps there might not be a need to reserve such a large amount of bootloader space.
Cheers,
JMA |
|
![](templates/subSilver/images/spacer.gif) |
ktallevi
Joined: 17 Dec 2005 Posts: 58
|
Setting PIC18F8722 Bootloader size |
Posted: Mon Nov 20, 2006 11:28 am |
|
|
The PIC18f8722 has more than enough room for my application outside of the bootloader.
My bootloader will work over multiple interfaces so I require code to configure those external interfaces. I may not require 8k by the time I optimize my code.
Anyways, setting the boot block size using config words is required. I am just not sure how to do it. I could use a bit-set assembly routine but that occurs at run-time only.
Perhaps a modification to 18F8722.h is required to set the CONFIG4L:BBSIZ bit? |
|
![](templates/subSilver/images/spacer.gif) |
jma_1
Joined: 08 Feb 2005 Posts: 147 Location: Wisconsin
|
|
Posted: Mon Nov 20, 2006 11:38 am |
|
|
Greetings,
After looking at the 18F8722, there is tons of space available.
I do not understand your need to use the configuration bits to set your protected boot block size. If you compile your application source code with the space set aside, your application does not overwrite the boot block. Please explain further why you want to use the configuration bits.
Cheers,
JMA |
|
![](templates/subSilver/images/spacer.gif) |
ktallevi
Joined: 17 Dec 2005 Posts: 58
|
|
Posted: Mon Nov 20, 2006 11:55 am |
|
|
by using the configuration bits to set the bootloader size, it protects against any accidental writes to the bootloader area while the device is in the field.
which the chances of that are slim, it is possible. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Nov 20, 2006 12:45 pm |
|
|
Quote: |
I noticed there is no #fuse to set the bootloader block size. CONFIG4L:BBSIZ bit.
I need to have a bootloader of 8k in size and protected.
|
I looked at the .H files for several related PICs (for vs. 3.249) and
they do have the Boot Block Size fuses defined. I think CCS may
have accidently left those fuses out of the Device Data file for the
18F8722. If you have PCWH, then you could use the Device Editor
to add those fuses. First look at the Device Data one of the PICs
shown below. Study how it's done in the device data file. Then
edit the data for the 18F8722 and do it the same way.
Note that the sizes shown below are in Words. To get the number of
of bytes, multiply the value by 2. For example, BBSIZ4K will protect 8 KB.
Quote: |
c:\program files\picc\devices\18f6527.h
// Fuses: NOMCLR,XINST,NOXINST,BBSIZ1K,BBSIZ2K,BBSIZ4K
c:\program files\picc\devices\18f6622.h
// Fuses: NOMCLR,XINST,NOXINST,BBSIZ1K,BBSIZ2K,BBSIZ4K
c:\program files\picc\devices\18f6627.h
// Fuses: NOMCLR,XINST,NOXINST,BBSIZ1K,BBSIZ2K,BBSIZ4K
c:\program files\picc\devices\18f6722.h
// Fuses: NOMCLR,XINST,NOXINST,BBSIZ1K,BBSIZ2K,BBSIZ4K |
|
|
![](templates/subSilver/images/spacer.gif) |
|