Regarding S12G Security

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

Regarding S12G Security

1,385 Views
tetsuya_nakamur
Contributor III

<Question>
1. Can it set FPROT and FSEC in CodeWarrior's option settings?

2. The customer uses CYCLONE PRO as a flash writer.
Can it set the security byte (FPROT and FSEC) with CYCLONE PRO?

 

0 Kudos
Reply
9 Replies

1,331 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

 

First of all it is necessary to understand FSEC and FPROT features.

FSEC is not possible to be changed. FPROT can be changed in the way only to increase protection but this is valid till next reset if it is done from outside just by modifying FPROT because after reset the FPROT is loaded from flash again.

I do not understand why they want to change security and protection for loaded MCU.

If the MCU is secured then there is no possibility to access these registers.

Moreover, I'll use info from the reference manual:
All bits in the FSEC register are readable but not writable. During the reset sequence, the FSEC register is loaded with the contents of the Flash security byte in the Flash configuration field at global address 0x3_FF0F located in P-Flash memory (see Table 24-4) as indicated by reset condition F in Figure 24-6. If a double bit fault is detected while reading the P-Flash phrase containing the Flash security byte during the reset sequence, all bits in the FSEC register will be set to leave the Flash module in a secured state with backdoor key access disabled.

 

The (unreserved) bits of the FPROT register are writable with the restriction that the size of the protected region can only be increased. While the RNV[2:0] bits are writable, they should be left in an erased state.

During the reset sequence, the FPROT register is loaded with the contents of the P-Flash protection byte in the Flash configuration field at global address 0x3_FF0C located in P-Flash memory (see Table 24-4) as indicated by reset condition ‘F’ in Figure 24-13. To change the P-Flash protection that will be loaded during the reset sequence, the upper sector of the P-Flash memory must be unprotected, then the P-Flash protection byte must be reprogrammed. If a double bit fault is detected while reading the P-Flash phrase containing the P-Flash protection byte during the reset sequence, the FPOPEN bit will be cleared and remaining bits in the FPROT register will be set to leave the P-Flash memory fully protected.

Trying to alter data in any protected area in the P-Flash memory will result in a protection violation error and the FPVIOL bit will be set in the FSTAT register. The block erase of a P-Flash block is not possible if any of the P-Flash sectors contained in the same P-Flash block are protected.

 

Best regards,

Ladislav

1,326 Views
tetsuya_nakamur
Contributor III

 

Dear Ladislav,

 

Thank you for the answer.

 

It seems like my intentions aren't getting across.

 

I would like to configure FSEC and FPROT security settings when generating a .s19 file.
Is there a way to do this using CodeWarrior options (GUI settings) instead of writing it directly in the source code?

 

Best Regards,

Tetsuya Nakamura

 

0 Kudos
Reply

1,247 Views
tetsuya_nakamur
Contributor III

 

Dear Ladislav,

 

How is the situation about below my question?

 

Please answer by tomorrow.

 

<question>

I would like to configure FSEC and FPROT security settings when generating a .s19 file.
Is there a way to do this using CodeWarrior options (GUI settings) instead of writing it directly in the source code?

 

Best Regards,

Tetsuya Nakamura

0 Kudos
Reply

1,222 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

as I already wrote ... No, there is no possibility to do it by GUI.

 

Best regards,

Ladislav

0 Kudos
Reply

1,211 Views
tetsuya_nakamur
Contributor III

 

Dear Ladislav,

 

It think FPROT can be written to, but are there not any settings that can be selected from the tabs that can be selected from CodeWarrior's Edit->P&E ICD Settings->Compiler for HC12->Options?

 

Best Regards,

Tetsuya Nakamura

 

 

0 Kudos
Reply

1,169 Views
tetsuya_nakamur
Contributor III

 

Dear Ladislav,

 

It has not solve the problem.

 

I am waiting for your answer below question in yesterday yet.

 

It think FPROT can be written to, but are there not any settings that can be selected from the tabs that can be selected from CodeWarrior's Edit->P&E ICD Settings->Compiler for HC12->Options?

 

Please answer early.

 

0 Kudos
Reply

1,136 Views
lama
NXP TechSupport
NXP TechSupport

Hi,


No, there is no possibility to do it by IDE options/settings/..... 

 

Best regards,

Ladislav

0 Kudos
Reply

1,355 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

A flash security example can be found here....

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12G-Examples-Pack/ta-p/1103919

 

The flash security and protection is the same for S12(X) and S12G so you can also study

https://community.nxp.com/t5/S12-MagniV-Microcontrollers/S12-X-MCU-Security/ta-p/1111118

to get info how to do it as a part of your code.

 

Normally, during debugging the MCU is unsecured by BDM debugging SW. Also, if you check S19 record and you did not set anything for FSEC register then it has erased value which means that each MCU is secured by default after programming and reset.

 

Regarding CYCLONE PRO ….. this must be directed to www.pemicro.com support.

 

Best regards,

Ladislav

0 Kudos
Reply

1,343 Views
tetsuya_nakamur
Contributor III

 

Dear Ladislav-san,

 

Thank you for the answer.

 

Please tell me how to set FPROT and FSEC using CodeWarrior's option settings instead of setting them directly in the source code.

 

Best Regards,

Tetsuya Nakamura

 

0 Kudos
Reply