MKE02Z64VLD2 - Flash Security Byte Address

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

MKE02Z64VLD2 - Flash Security Byte Address

1,383 Views
satbir7
Contributor III

Hello again,

I have a doubt about the Address of FSEC byte mentioned in the reference manual for MKE02Z64VLD2.

fsecMan.PNG

According to the manual snippet above, the following  flash configuration should secure the  MCU;

FlashConfig.PNG

 But that is not true, the above code gives me the following FTMRH register read out;


ftrmhRegisters.PNG

My FSEC value of 0x7D shows up in the FPROT register instead!

I know that while I am in debug mode the MCU is unsecured, hence I will only see FSEC as 0xFE, but the 0x7D should not go to the FPROT address. 

But, If I use the following Flash Config, then it appears to secure the MCU correctly;

secFlashConfig.PNG

secFtrmhRegisters.PNGThis only means one thing that the address description in the manual is incorrect  correct but my interpretation is incorrect. 

Spoiler
Seems like it is the  classic Little Endian messing with me!!

Please advice @ErichStyger @kerryzhou .

Thanks,
Satbir

Labels (1)
0 Kudos
Reply
2 Replies

1,349 Views
mjbcswitzerland
Specialist V

Hi

Please check the binary file that you are loading to verify that the bytes are at the correct locations in it.

Beware that some debuggers don't allow programming of the values in the image without first unlocking this function (for safety reasons so that people don't inadvertently lock chips).

If you secure the device I expect that after a further reset it would no longer be possible to connect with the debugger to view the registers.

I would recommend testing patterns that don't secure the flash (also in the unused 0x408..0x40b area) and reading them back directly from the flash so that you are sure they are programmed as expected before interpreting the values seen in the FTMRH registers.

Regards

Mark

 

1,316 Views
satbir7
Contributor III

Thanks for the reply!

It was the Little Endian messing with me!!

I also verified the .bin  file and  observed the correct placement of the  Security Byte.

 

Satbir

0 Kudos
Reply