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

18LF8722 wont bootload with WRTB enabled

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



Joined: 07 Nov 2012
Posts: 6

View user's profile Send private message

18LF8722 wont bootload with WRTB enabled
PostPosted: Wed Nov 07, 2012 12:12 pm     Reply with quote

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
Code:
#FUSES NOWRTB

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: 19466

View user's profile Send private message

PostPosted: Wed Nov 07, 2012 1:08 pm     Reply with quote

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

View user's profile Send private message

Well there's your problem
PostPosted: Wed Nov 07, 2012 1:23 pm     Reply with quote

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: 19466

View user's profile Send private message

PostPosted: Wed Nov 07, 2012 1:28 pm     Reply with quote

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
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