|
|
View previous topic :: View next topic |
Author |
Message |
Blob
Joined: 02 Jan 2006 Posts: 75 Location: Neeroeteren, Limburg, Belgium
|
conFUSE bits |
Posted: Thu Sep 16, 2010 6:46 am |
|
|
Hello all,
I am finishing my pic project.
Now I want to keep my code protected from reading using the FUSE bits.
I use a 18f2620
the situation is like this:
I use serial communication to communicate through a ftdi to the USB of my pc.
in the serial loop I write data to the eeprom and also to the program memory (reserved locations)
The program memory is written in blocks of 64 bytes but is read in 2 or 4 bytes.
In the 18f2620 I have following "protection" FUSE bits at my disposal:
PROTECT Code protected from reads
CPB Boot Block Code Protected
CPD Data EEPROM Code Protected
WRT Program Memory Write Protected
WRTC configuration registers write protected
WRTB Boot block write protected
WRTD Data EEPROM write protected
EBTR Memory protected from table reads
EBTRB Boot block protected from table reads
In order to have my code working, including read-write from within my "serial loop" I have to set the fuse bits like this:
Code: |
#fuses PROTECT //Code protected from reads
#fuses CPB //Boot Block Code Protected
#fuses CPD //Data EEPROM Code Protected
#fuses NOWRT //Program Memory not Write Protected
#fuses WRTC //configuration registers write protected
#fuses WRTB //Boot block write protected
#fuses NOWRTD //Data EEPROM not write protected
#fuses NOEBTR //Memory not protected from table reads
#fuses EBTRB //Boot block protected from table reads |
I have some questions regarding these settings:
1) I don't use a boot loader, so I am not sure it is wise to set its read / write protection?
2) I have to set NOWRT, if I don't I can not access my reserved memory.
Will setting this bit have an impact on my code safety?
does setting NOWRT have an influence on the WRTC and WRTB fuses
or is it sufficient to set WRTC, WRTB and NOWRTD? (deleting NOWRT?)
3) I have to set NOEBTR, if I don't I can not access my reserved memory.
Will setting this bit have an impact on my code safety?
Is setting these bits enough to protect my code, or can I take other measures to do so?
Thanks in advance,
BLOB |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Sep 17, 2010 4:09 pm |
|
|
To protect your code from being read, at a minimum you need to use
these fuses:
This will prevent a programmer (ICD2, PicStart-Plus, etc) from reading
the program memory. This includes the Boot Block (protected by CPB).
If you want to protect the Data eeprom from being read, then also use
this fuse:
|
|
|
|
|
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
|