View previous topic :: View next topic |
Author |
Message |
jventerprises
Joined: 01 Apr 2004 Posts: 43 Location: Boston
|
Boot Segment Program Write Prot bit 30F5011 |
Posted: Fri Nov 12, 2010 4:54 pm |
|
|
Hi,
Is there something I am missing about codeGuard and the DSPIC30F5011?
I want to just unsecure the entire memory range, ie General Segment with no protection.
My fuses look correct, but my Boot segment protection bit (FBS:0) always comes back as protection set even though I have requested it shouldn't.
I am running at 5v
here are my fuses
Code: |
#include <30F5011.h>
#device *=16
#device ICD=TRUE
#device WRITE_EEPROM=NOINT // NO write_eeprom calls in ISRs!!
#FUSES NOWDT //No Watch Dog Timer
#FUSES FRC_PLL4 //Internal Fast RC oscillator with 4X PLL
#FUSES NOCKSFSM //Clock Switching is disabled, fail Safe clock monitor is disabled
#FUSES WPSB16 //Watch Dog Timer PreScalar B 1:16
#FUSES WPSA512 //Watch Dog Timer PreScalar A 1:512
#FUSES PUT64 //Power On Reset Timer value 64ms
#FUSES BROWNOUT //brownout reset
#FUSES BORV20 //Brownout reset at 2.0V
#FUSES MCLR //Master Clear pin enabled
#FUSES NOWRTB //Boot block not write protected
#FUSES NOBSS //No boot segment
#FUSES NOEBS
#FUSES NORBS //No Boot RAM defined
#FUSES NOWRTSS //Secure segment not write protected
#FUSES NOSSS //No secure segment
#FUSES NOESS
#FUSES NORSS //No secure segment RAM
#FUSES NOWRT //Program memory not write protected
#FUSES NOPROTECT
|
and the bits from the hex file
00008301 0000003F 00008030 00003107 00003307 00000007 00004003
^
The item in question always comes back as a 00003106 instead of 00003107 which enables the boot segment write protect.
I have not posted the entire project since it is huge, but I can if needed.
I must be missing something about codeguard but I can't see what! _________________ Jon
Last edited by jventerprises on Fri Nov 12, 2010 8:21 pm; edited 2 times in total |
|
|
jventerprises
Joined: 01 Apr 2004 Posts: 43 Location: Boston
|
tried 4.114 |
Posted: Fri Nov 12, 2010 8:02 pm |
|
|
problem still exists in 4.114 _________________ Jon |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sat Nov 13, 2010 6:12 am |
|
|
CCS managed to introduce several faults with 30F5011 configuration fuses. The most important point is to refer
to MPLAB to get a second opinion about correct fuse coding. It may be wrong in some cases, but most likely not
for months or even years. MPLAB reveals, that WRTB/NOWRTB operation has been inversed.
The second point is, you can avoid the problems easily by specifying no boot sector related fuses at all. You get F80006 = 310F,
which is decoded by MPLAB as all boot sector features and protection disabled.
As often told in the CCS forum, you can always set all configuration bits directly by a #ROM statement, geting rid of the
compilers erroneous beliefs. Ìf you want correct operation of all configuration fuse commands in PCD, file a bug
report and patiently wait for CCS to fix the issue, or start the IDE device editor tool and fill in the correct fuse codes yourself. |
|
|
jventerprises
Joined: 01 Apr 2004 Posts: 43 Location: Boston
|
Now working |
Posted: Sun Nov 14, 2010 8:37 am |
|
|
Thanks for the suggestions, I had discovered the inversion of the WRTB but in order to clear it I had to change my operating voltage from 3.3 to 5. It was extremely annoying.
I have followed your suggestion and just set the config bits directly, not relying on the #FUSE directive.
Currently I have one giant general segment with no protection. I have tried to enable standard security on that section but the PIC refuses to accept it. No matter what I program I get no protection. I assumed it was because I only had one segment defined, so I have enabled the boot and secure segments but to no avail.
Thanks _________________ Jon |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Sun Nov 14, 2010 8:47 am |
|
|
There are possibly more bugs in the present PCD implementation of 30F5011 fuses. I don't use the chip, so I can't check if certain settings can be programmed. As said, I would check the fuse settings with MPLAB. |
|
|
|