View previous topic :: View next topic |
Author |
Message |
hhockersmith
Joined: 07 Nov 2012 Posts: 6
|
18LF8722 wont bootload with WRTB enabled |
Posted: Wed Nov 07, 2012 12:12 pm |
|
|
I have a strange problem I have noticed. I decided to enable the boot block protection bit after we accidently overwrote the bootloader in the field on day. Thankfully this was during testing and not an upgrade sent out during production. Here is my issue:
When I change the fuses in my boot loader to:
Code: | #FUSES WRTB
#FUSES BBSIZ1K |
the system will not bootload our code. However if I change it back to
the bootloader runs and activates. Our main code has the following lines at the top to have it skip the bootloader:
Code: | #build (reset=0x400, interrupt=0x408)
#org 0, 0x3ff {} |
Which works when there is no protection.
Any thoughts on what is going on? Why would it work without the protection but not with? _________________ *Sigh* How many times do I have to tell you managers I am not a miracle worker, I am one man. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19589
|
|
Posted: Wed Nov 07, 2012 1:08 pm |
|
|
Problem is the smallest boot-block size that can be protected is 1K _words_ not bytes. Ends at 0x7FF. Look at figure 5-2 in the data sheet. Column 2.
Best Wishes |
|
|
hhockersmith
Joined: 07 Nov 2012 Posts: 6
|
Well there's your problem |
Posted: Wed Nov 07, 2012 1:23 pm |
|
|
Ahhhh. That would do it. I was not thinking in words but bytes. I assume then that the simple way to fix this would be to reorg the system out beyond 0x800 and go from there?
Code: | #build (reset=0x800, interrupt=0x808)
#org 0, 0x7ff {} |
_________________ *Sigh* How many times do I have to tell you managers I am not a miracle worker, I am one man. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19589
|
|
Posted: Wed Nov 07, 2012 1:28 pm |
|
|
Yes, it does get confusing with chips commonly using bytes, 16bit words, 32bit words & 64bit words. Then the 14bit words on the smaller PIC's (though the program data gets passed as pairs of bytes with bits missing). Then try 20bit ones, 24bit, 40bit, and 60bit ones, that some more exotic systems use.....
and, yes, put the application at 0x800 and it should all start working.
Best Wishes |
|
|
|