S32K118 Code Protection

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

S32K118 Code Protection

2,954 Views
melvinw
Contributor II

Currently I'm working on a project with a S32K118 MCU, the S32DS SDK V3.4 IDE and a MULTILINK UNIVERSAL debug probe.

And It's not clear to me how i can enable a code protection feature to prevent reading of code from a custom programmed device. 

For example for Microchip devices it's possible to enable this feature in the MCC generator.

The questions i have about this topic are:

1. Is this feature even available and how do i implement this? (Or find the correct documentation about this topic?)

2. Is it possible to enable this feature in the MCUExpresso configurator somewhere?

3. Is it possible to flash a S32K118 MCU with the Multilink Universal debug prope with code protection (and how?) or do i need different hardware for this?

Thanks in advance for any support!

 

Tags (2)
0 Kudos
Reply
4 Replies

2,910 Views
melvinw
Contributor II

@VaneB Thank for the reply. 

I was able to protect te code by changing the FSEC bits to FF instead of FE. But i ran into another problem regarding this topic.

In our project we are using a SWD interface (with multilink universal debug probe) and aren't able to use JTAG. We also have a bootloader that needs to be able to overwrite previous code protected flash sections and overwrite it with new firmware. 

At this moment we can only achieve a programmed module with code protection and the Multilink Universal in the way describe in a previous topic:

https://community.nxp.com/t5/S32K/S32K144-Setting-FSEC-bits-to-Secure/m-p/1595694

But this means programming the module 2 times. 1 time with the code and a second time with memory preservations to only set the FSEC bits. 

1. Isn't there another way to do this instantly with the S32DS Debug Configurations & Multilink Universal Debug probe? ( Or is other hardware required to do this?)

2. How is this done in a mass production setup? Is there other hardware required to flash bootloader + application + FSEC protection in a single go?

Still going to documentation at this time btw.

Thanks again in advance!

 

 

0 Kudos
Reply

2,930 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @melvinw 

The S32K1 family can limit access to Flash right and disable access to the MCU through JTAG. This is by the FSEC[SEC] bit configuration. 

If you limit the access right to Flash using FSEC[SEC], the registers that reside within the JTAG and debug logic can be accessed via the debug port, but no other registers or memory inside the processor.

To enable or disable the JTAG interface. You must manipulate the Flash section in the startup code.

 

/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF     /* 8 bytes backdoor comparison key           */
.long 0xFFFFFFFF     /*                                           */
.long 0xFFFFFFFF     /* 4 bytes program flash protection bytes    */
.long 0xFFFF7FFE     /* FDPROT:FEPROT:FOPT:FSEC(0xFE = unsecured) */

 

Please refer to section 36.4.4.1.4 of the S32K1xx Series Reference Manual, Rev. 13.

Also, Check the following application notes. There should be information related to this topic which you might find useful.

 

B.R.

VaneB

0 Kudos
Reply

2,909 Views
melvinw
Contributor II

@VaneB Thank for the reply. 

I was able to protect te code by changing the FSEC bits to FF instead of FE. But i ran into another problem regarding this topic.

In our project we are using a SWD interface (with multilink universal debug probe) and aren't able to use JTAG. We also have a bootloader that needs to be able to overwrite previous code protected flash sections and overwrite it with new firmware. 

At this moment we can only achieve a programmed module with code protection and the Multilink Universal in the way describe in a previous topic:

https://community.nxp.com/t5/S32K/S32K144-Setting-FSEC-bits-to-Secure/m-p/1595694

But this means programming the module 2 times. 1 time with the code and a second time with memory preservations to only set the FSEC bits. 

1. Isn't there another way to do this instantly with the S32DS Debug Configurations & Multilink Universal Debug probe? ( Or is other hardware required to do this?)

2. How is this done in a mass production setup? Is there other hardware required to flash bootloader + application + FSEC protection in a single go?

Still going to documentation at this time btw. 

Thanks again in advance!

 

 

0 Kudos
Reply

2,893 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @melvinw 

Please check the content at the following link. There should be information related to this CSEc that you might find useful.

AN5401: Getting Started with CSEc Security Module

AN5401SW

AN12130: Production Flash Programming Best Practices for S32K1xx MCUs

0 Kudos
Reply