Who is responsible for setting the security byte?

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

Who is responsible for setting the security byte?

402 Views
AndersJ
Contributor IV

Working with a S12X bootloader I notice that erasure will

also erase the security byte at 0xFF0F, thus securing the device.

 

This byte is normally set to 0xFE after programming with a programmer

such as the USB-Mulitilink or the Cyclone Pro.

The byte is not included in the S19 file,

so my bootloader will need to take care of this silently while programming.

 

Is the above a correct description of how this works?

 

Is it correct to to write the security byte as I describe?

Or, should it be included in the S19 file in the first place,

which to me seems to be the correct way of doing this.

 

Can CodeWarrior be instructed to include the security byte in the S19 file,

or do I need to provide it myself in my source code?

What would be the correct way of ensuring a value is written to a explicit address

such as writing 0xFE to the security byte location at 0xFF0F?

 

Thanks,

Anders J

Labels (1)
0 Kudos
1 Reply

232 Views
kef
Specialist I
  • Or, should it be included in the S19 file in the first place,
  • which to me seems to be the correct way of doing this.

I prefer to define NVSEC abd NVPROT bits in S19 file. But it depends on your flash burning tools if you can use it or not. You may get verify error or your defined NVSEC ignored at all. For Hiwave debugger you should use "FLASH NOUNSECURE" command to tell it you want to specify your own version of NVSEC. I'm not sure if your CW version accepts this command or not, but here's excerpt from release notes:

 

==========================icd12.tgt version V6.1.17==========================List of New Features---------------------The "FLASH NOUNSECURE" command can be used from a Startup or Preload command file to assert that the  Flash Programmer does NOT program the security byte to "unsecured" state. The security byte is then free to be setup by the user code without any risk of overprogramming.

 

0 Kudos