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

Boot Block Table Read protection makes code non-functional

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



Joined: 16 Jan 2008
Posts: 61

View user's profile Send private message

Boot Block Table Read protection makes code non-functional
PostPosted: Wed Aug 24, 2011 12:40 pm     Reply with quote

Hi everyone,

We are using PIC18F25K20 processor. We have our code size 96% of ROM and 31% of RAM. We ask Microchip to program our CCS code. In their configuration bit setting we put Boot Block Table Read Protection Enable. After doing that our code doesn't work, if you remove that setting then it works. Microchip came back to us and asked if our code is writing in that area which we don't. Is there anyway to find out if on these locations we can not write? How we can debug the issue?

Any help will be appreciated.

nehal
_________________
nehal
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 24, 2011 1:03 pm     Reply with quote

Edit the 18F25K20.h file and comment out the line where it says #nolist,
as shown below.
Quote:
//////// Standard Header file for the PIC18F25K20 device #device PIC18F25K20
//#nolist
//////// Program memory: 16384x16 Data RAM: 1536 Stack: 31
//////// I/O: 25 Analog Pins: 13
//////// Data EEPROM: 256
//////// C Scratch area: 00 ID Location: 200000


Compile your program and then search the .LST file for this word:
Quote:

TBLRD
nehallove



Joined: 16 Jan 2008
Posts: 61

View user's profile Send private message

PostPosted: Wed Aug 24, 2011 1:19 pm     Reply with quote

What we found that we have some TBLRD instructions which we use for the constants we defined. Does that affect? Does that store something on the BOOT Block Table Read Protection Area?

Thank you.
nehal
_________________
nehal
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 24, 2011 3:06 pm     Reply with quote

Are any of the TBLRD instructions attempting to read the address range
(000h-7FFh) of the Boot Block area ?
nehallove



Joined: 16 Jan 2008
Posts: 61

View user's profile Send private message

PostPosted: Wed Aug 24, 2011 7:00 pm     Reply with quote

which instruction i am looking at ?

.................... temp1=(float)(temp_tbl[i])*10;
257A: BCF FD8.0
257C: RLCF x26,W
257E: CLRF 03
2580: MOVFF FF2,22F
2584: BCF FF2.7
2586: MOVLB 0
2588: CALL 023C
258C: TBLRD*+
258E: MOVFF FF5,03
2592: MOVLB 2
2594: BTFSC x2F.7
2596: BSF FF2.7
2598: MOVLB 3
259A: MOVWF x7E
259C: MOVFF 03,37F
25A0: MOVLB 0
25A2: CALL 101C
25A6: MOVFF 00,230
25AA: MOVFF 01,231
25AE: MOVFF 02,232
25B2: MOVFF 03,233
25B6: MOVFF 03,39D
25BA: MOVFF 02,39C
25BE: MOVFF 01,39B
25C2: MOVFF 00,39A
25C6: MOVLB 3
25C8: CLRF xA1
25CA: CLRF xA0
25CC: MOVLW 20
25CE: MOVWF x9F
25D0: MOVLW 82
25D2: MOVWF x9E
25D4: MOVLB 0
25D6: CALL 15A4
25DA: MOVFF 03,22A
25DE: MOVFF 02,229
25E2: MOVFF 01,228
25E6: MOVFF 00,227


I can not see any instruction which clearly says the locations.

Thanks.
_________________
nehal
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu Aug 25, 2011 12:40 am     Reply with quote

It can be expected, that call 023c is a constant load routine, setting TBLPTR to a succeeding memory location. In this case TBLRD*+ will fail, when table read protection is set for the boot block.
Code:
2588: CALL 023C
258C: TBLRD*+


Generally, this kind of boot block protection only makes sense, if the boot block is exclusively reserved to the boot loader. Obviously this isn't the case in your application.
nehallove



Joined: 16 Jan 2008
Posts: 61

View user's profile Send private message

PostPosted: Fri Aug 26, 2011 1:05 pm     Reply with quote

Thank you very much for the help.

nehal Smile
_________________
nehal
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