View previous topic :: View next topic |
Author |
Message |
Guest
|
Code Protection Problem |
Posted: Fri Feb 23, 2007 5:12 am |
|
|
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
|
|
Posted: Fri Feb 23, 2007 5:35 am |
|
|
You can check the generated configuration bits at the bottom of the list file (*.lst).
Which compiler version are you using? |
|
|
Guest
|
|
Posted: Fri Feb 23, 2007 5:57 am |
|
|
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
|
|
Posted: Fri Feb 23, 2007 6:06 am |
|
|
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
|
|
Posted: Fri Feb 23, 2007 6:07 am |
|
|
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
|
|
Posted: Fri Feb 23, 2007 9:20 am |
|
|
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 |
|
|
|