Secure mode and OTA updates

cancel
Showing results for 
Search instead for 
Did you mean: 

Secure mode and OTA updates

Jump to solution
80 Views
Contributor IV

My K8x gets locked when programming.  This is not a problem in a development environment, where I use Segger J-Link commands to unlock it.   This is not viable in a production environment, with Over-The-Air (OTA) updates.

Flash_Config is unaltered from factory defaults - (FOPT = 0x3D, FSEC = 0xFE) - which I take to mean that the secure lock feature should not be in play.  I do not use a mass erase because some data sections in internal flash may need to be preserved.  To program the chip an OTA update package is sent to the device, and staged on external SPI NOR Flash.  The package contains the target with a header - load address, length, and ECDSA (signature). The staged file is checked for integrity, and a RAM function erases sufficient 4K blocks, and then writes the target. The MCU is reset and the system reboots.

Except that sometimes it doesn't!  Connecting J-Link I find the chip in a secure locked state.

What causes this, and how do I overcome it?

Labels (1)
0 Kudos
1 Solution
14 Views
NXP TechSupport
NXP TechSupport

Hi Denis Collis,

  Do you mean, you didn't secure the chip in the code FOPT, but the Kinetis chip is locked up during program, right?

  If yes, please check this document at first:

https://community.nxp.com/servlet/JiveServlet/download/2019-439921-857127-396709/Kinetis+Lock+issue+...

   Whether you meet the requirement in the document.

  If you still have issues about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
2 Replies
15 Views
NXP TechSupport
NXP TechSupport

Hi Denis Collis,

  Do you mean, you didn't secure the chip in the code FOPT, but the Kinetis chip is locked up during program, right?

  If yes, please check this document at first:

https://community.nxp.com/servlet/JiveServlet/download/2019-439921-857127-396709/Kinetis+Lock+issue+...

   Whether you meet the requirement in the document.

  If you still have issues about it, please kindly let me know.

Best Regards,

Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

0 Kudos
14 Views
Contributor IV

Hi kerryzhou‌, 

Correct, I did not secure the chip, but it failed to run after reset.  After a little research I now see that the lock can only  occur when I later connect with J-Link.  My guess is that the FSEC bits got corrupted during programming.   (Of course, I need J-Link to inspect flash to figure out why it failed to program!  But I have some other ideas how to do it).

I suspect a programming error.  I'll report back later, but for now I'll mark your answer correct.

Thanks,

Denis

0 Kudos