Trouble programming FSEC to the recommended secure state

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Trouble programming FSEC to the recommended secure state

2,419 Views
xgater
Contributor I
CPU: MC9S12XDT256
 
I am enabling security in my application by programming the address $FF0F to $BD. The problem is that my programmer (P&E Cyclone Pro) fails verification and says that address reads as $BC. According to the CPU user manual, the preferred state of the SEC (least significant) bits to enable security is 01 even though it says that 00 is also secure. If I change my code to set the security byte to $BC, then it passes verification. So, I may leave it that way even though it is not "preferrred". I can't find anywhere in to user manual or app notes that says this one bit can't be left erased or can't be read back.
 
Does anyone have a clue why this one byte won't verify?
 
Labels (1)
0 Kudos
Reply
4 Replies

723 Views
peg
Senior Contributor IV
Hi xgater,
 
I don't know this device, but this sounds very similar to this thread:
 
 
Hope it helps
 
HNY!
 
Regards
Peg
 
0 Kudos
Reply

723 Views
StephenRussell
Contributor I
I also believe that the referenced thread is about the same problem.
 
Freescale recommends that you program the security bits to "unsecured" as part of erasing flash.  The Freescale recommended 27 step unsecuring method does this.  Simple flash programming utilities do this routinely after doing a bulk erase of flash.
 
If this recommendation is followed, the only value that can be programmed without another erase is 00.  Doing this "cumulative programming" violates Freescale recommendations, but does work.
 
The proper method would be to read the sector containing 0xFOFE, erase it, and program it with the modified values.  As far as I can tell, many programming utilities do not consider doing sector reprogramming and don't do this.
 
 
0 Kudos
Reply

723 Views
xgater
Contributor I
Thanks. This makes sense now. So, to sum it up....
 
The SEC bits are set to the unsecure state (10) by the BDM tools because they have to be for BDM access. (duh! I should have realized this on my own.)
This means that the only option for securing the part is to program the other bit resulting in SEC bits 00.
So, the "recommended" value should just be ignored.
 
I will just set SEC to 00 and all is well.
 
Thanks, again.
 
0 Kudos
Reply

723 Views
NLFSJ
Contributor III

Hi,

I don't have an answer on this, you may want to contact P&E. But have the following information for you -if sec1 and sec0 of 0xFF0F is not 10, any other 3 combination will secure HCS12 mcu, i.e for your situation, -- BC, BD and BF should all secure the chip.

Regards,

Nina

0 Kudos
Reply