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

Boot Segment Program Write Prot bit 30F5011

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



Joined: 01 Apr 2004
Posts: 43
Location: Boston

View user's profile Send private message Visit poster's website

Boot Segment Program Write Prot bit 30F5011
PostPosted: Fri Nov 12, 2010 4:54 pm     Reply with quote

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

View user's profile Send private message Visit poster's website

tried 4.114
PostPosted: Fri Nov 12, 2010 8:02 pm     Reply with quote

problem still exists in 4.114
_________________
Jon
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Sat Nov 13, 2010 6:12 am     Reply with quote

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

View user's profile Send private message Visit poster's website

Now working
PostPosted: Sun Nov 14, 2010 8:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Nov 14, 2010 8:47 am     Reply with quote

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.
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