How to differentiate the MCU is secure or not?

cancel
Showing results for 
Search instead for 
Did you mean: 

How to differentiate the MCU is secure or not?

420 Views
aaronlee
Contributor V

Hi,

Q1. How to differentiate the MCU is secure or not? Have the simple way to do?

Q2. Is it secure or not when i flash MCU done?

pastedImage_1.png

Tags (3)
0 Kudos
6 Replies

92 Views
stanish
NXP Employee
NXP Employee

Hi Aaron,

If you want to avoid flash programming in case the device is not secured I'd recommend you to rather to attach to a running device instead of Download:

pastedImage_1.png

If the device is secured you will see invalid content like this:

pastedImage_2.png

If it's unsecured you should see a valid memory dump.

Hope it  helps.

Stan

0 Kudos

92 Views
aaronlee
Contributor V

Hi Stan,

Thank you very much.

Best Regards,

Aaron

0 Kudos

92 Views
lama
NXP TechSupport
NXP TechSupport

Hi,

I hope I understand you well.

When the device is secured then you are not able to neither load the code into it

pastedImage_1.png

nor connect to it and the CW reports it before download.

When the mcu is secured then you can see after download:

pastedImage_2.png

The only BDM command which is accessible is mass errase which is able to clear entire memory and set the security bits to the unsecure status. Unsecuring can be performed by CW or external program.

So easily, if you are able to connect to it by BDM before loading the code or hot plugin then it is not secured.

Have you tried to secure the device and then to connect to it? You will see what happens.

If you want to secure the device then just add following on the top of your code as a global variable:

const unsigned char flash_array[] @ 0xFFFE08 =     // secure the device without backdoor key
   {
    0xFF,   //0xFFF08  
    0xFF,   //0xFFF09  
    0xFF,   //0xFFF0A  RESERVED
    0xFF,   //0xFFF0B  RESERVED
    0xFF,   //0xFFF0C  FPROT
    0xFF,   //0xFFF0D  DFPROT
    0xFF,   //0xFFF0E  FOPT
    0xFC,   //0xFFF0F  FSEC - SECURED without backdoor key
   };

Best regards,

Ladislav

0 Kudos

92 Views
aaronlee
Contributor V

Dear Ladislav,

I am a new NXP user. I only know how to Build, Debug & Flash in Commander.

pastedImage_7.png

So, I want to learn how to secure and unsecured.  Your reply very detail. Thank you very much. Now, I understand how to do that.

I have another question. How to read unsecured MCU (Ex. S12ZVCA) and save it to PC?

Best Regards,

Aaron

0 Kudos

92 Views
lama
NXP TechSupport
NXP TechSupport

Let's assume there is running code in the MCU.

The easiest way is to create a new bareboard project

pastedImage_5.png

and do not change anything but:

1) Open a debug configuration

pastedImage_2.png

2) Select attach

pastedImage_1.png

3) You can look into a memory window and press export

pastedImage_3.png

4) Select entire memory and the name of the file

pastedImage_4.png

Thats all.....

best regards,

Ladislav

0 Kudos

92 Views
aaronlee
Contributor V

Hi Ladislav,

Thank you very much.

Best Regards,

Aaron

0 Kudos