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 CCS Technical Support

Code Protection Problem

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








Code Protection Problem
PostPosted: Fri Feb 23, 2007 5:12 am     Reply with quote

am using ICD 2 to program PIC18F6585. I had set the fuse as below:

#fuses NOWDT,PUT,PROTECT,NOBROWNOUT,NOLVP,HS, CPD,STVREN

But I can still read the program code, it seem to be not protected.

I did setting on MPLAB�s Configuration Bit Dialog (attached) , it didn�t as well. If the fuse setting and dialog setting are unmatch, which has higher priority? Will the command line FUSE setting override the setting?

I understand that code protection is not allowed when debugging, but I use ICD 2 as programmer.

I set the debugger as MPLAB SIM and programmer as ICD 2 in MPLAB.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Fri Feb 23, 2007 5:35 am     Reply with quote

You can check the generated configuration bits at the bottom of the list file (*.lst).

Which compiler version are you using?
Guest








PostPosted: Fri Feb 23, 2007 5:57 am     Reply with quote

Thks for your fast reply.

The configuration bit as below:
Configuration Fuses:
Word 1: 2200 HS NOOSCSEN
Word 2: 1E0C NOBROWNOUT NOWDT BORV20 PUT WDT32768
Word 3: 8383 CCP2C1 MCLR
Word 4: 0081 STVREN NODEBUG NOLVP
Word 5: 4008 PROTECT CPD NOCPB
Word 6: E00F NOWRT NOWRTD NOWRTC NOWRTB
Word 7: 400F NOEBTR NOEBTRB

Looking at word 5, it is protected. But why MPLAB didn't prompt any massage when I attempted to read. It prompted me:

.EEPROM
...Program Memory (0x0 - 0xBFFF)
.. Config Memory
...User ID Memory
...Read Succeeded
MPLAB ICD 2 Ready

Seem to be no read problem.


The Version:
CCS PCH C Compiler, Version 4.025, 37591 23-Feb-07 18:33
iw2nzm



Joined: 23 Feb 2007
Posts: 55

View user's profile Send private message

PostPosted: Fri Feb 23, 2007 6:06 am     Reply with quote

Quote:
Looking at word 5, it is protected. But why MPLAB didn't prompt any spam when I attempted to read. It prompted me:

.EEPROM
...Program Memory (0x0 - 0xBFFF)
.. Config Memory
...User ID Memory
...Read Succeeded
MPLAB ICD 2 Ready

Seem to be no read problem.


Go to View -> Program Memory in MPLAB menu and check if you actually can see the code.

Marco / iw2nzm
Guest








PostPosted: Fri Feb 23, 2007 6:07 am     Reply with quote

I tried to re-launch MPLAB with initial setting of configuration bit and empty program memory window.

Ther were updated after I executint read command.

The program memory window become full of program codes.
And the configuration bit dialog Code Protection become --- ENABLED.
But, ironically, I can still read the program code from the chip.
Ttelmah
Guest







PostPosted: Fri Feb 23, 2007 9:20 am     Reply with quote

But does what you read 'agree' with what you put in there?. The protection, does not prevent you reading the chip. However what you read, should be encrypted, and no longer agree with what was written.

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