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

Verifying code protected data with the ICD

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







Verifying code protected data with the ICD
PostPosted: Wed Aug 16, 2006 3:08 pm     Reply with quote

Hi,

I am using two micros, the PIC18F6722 and the PIC18F4550. I am trying to code protect them. I used #fuses PROTECT and verified in the .lst file that configuration word 5 shows PROTECT. When I compile it and download it with CCS's ICD it runs through writing the data and verifying. I would expect, if the code is truly code protected, that the ICD would not be able to verify the code. However, it says it successfully verifies the code. Is my code truly not code protected or is there something wrong with the ICD. Confused

Thanks,
j_girl
Guest








PostPosted: Wed Aug 16, 2006 3:37 pm     Reply with quote

I think I can take this one,

If I remeber right the code verify uses the hash of the block it reads. So it doesn't have access to the data, just the hash of whats in there. So it ca verify it, without having to read it.

I might be wrong, but I think I remember reading that somewhere
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Aug 16, 2006 5:53 pm     Reply with quote

I programmed a 16F877 with the PROTECT fuse enabled, with an ICD2
in MPLAB. It gives a progress report of the programming operations.
You can see that it programs the Program Memory first and then verifies
it. Then it does the Config Memory (and sets the PROTECT fuse) and
verifies that. There's no hashing involved. It just does things in the
proper sequence.
Quote:
Programming Target...
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0x76)
Verifying...
...Program Memory
...Verify Succeeded
Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
...Verify Succeeded
...Programming succeeded
MPLAB ICD 2 Ready


The sequence above happens when the PIC is programmed.
If I try to do a separate verify operation after the chip is programmed,
then MPLAB gives me an error message, as expected:
ICD0161: Verify failed (MemType = Program, Address = 0x0, Expected Val = 0x3000, Val Read = 0x0)
j_girl
Guest







PostPosted: Thu Aug 17, 2006 1:41 pm     Reply with quote

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