S32K148 SEC bits doesn't get set

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

S32K148 SEC bits doesn't get set

Jump to solution
1,447 Views
janijärvenpää
Contributor II

I am having trouble trying to set the SEC bits,
I have set the FSEC to 0xF9 on startup file

janijärvenpää_1-1613032994165.png

I inspected the resulting binary to be correct

janijärvenpää_0-1613032877166.png

0xF9 should result to this:

janijärvenpää_2-1613033316949.png

After flashing that binary i read the memory and it's otherwise correct, but SEC bits doesn't get set?

janijärvenpää_3-1613033423062.png


I tried this with GDB also with following commands:
(gdb) target remote 127.0.0.1:2331
(gdb) monitor reset
(gdb) set {char}0x40c = 0xf9
(gdb) x/1bx 0x40c
0x40c: 0xfa


I don't undenstand how it does not get set? i can set other bits but not those two.

I am just trying to disable reading the program from JTAG/SWD.

Thanks in advance,
Jani

 

0 Kudos
1 Solution
1,356 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

maybe this is the reason:

lukaszadrapa_0-1613490426280.png

 Regards,

Lukas

 

View solution in original post

0 Kudos
6 Replies
1,432 Views
janijärvenpää
Contributor II

Ok so this happens with Jlink edu mini only.

Tested with following setup:
-S32K148EVB
-Jlink edu mini

software setup:
-Bootloader with FSEC set to 0xF9
-Application that is at different location in memory.

Loaded bootloader with PEMicro/OpenSDA, and it worked fine. I got that Device is secured prompt.
Then loaded application with JLINK and device got erased without any prompt,
and application got written to the memory, and bootloader got erased.

Not so nice behavior with this debugger. Will see later how this behaves with JLink Base as debugger.


0 Kudos
1,403 Views
janijärvenpää
Contributor II

The same exact behavior happens with JLink BASE Compact also.

0 Kudos
1,383 Views
janijärvenpää
Contributor II

Tested this with different configurations.
Using S32K148EVB-Q176 Rev B, tested with both 3.3V and 5V options of J7 jumper.
Also tested with custom board with same part number on the mcu, board has 3.3V supply voltage.
In any of these configurations, neither BASE Compact or EDU Mini got these bits set.

Can someone confirm that S32K148EVB-Q176 gets secured with some specific debug probe or production programmer?

 

0 Kudos
1,369 Views
janijärvenpää
Contributor II

Solution found at https://wiki.segger.com/S32Kxxx
JLink GDB server device needs to be S32K148 (allow security) instead of S32K148

Now this works with segger debug probes. 0x40C gets set to 0xF9 . For some reason addresses from 0x0 to 0x7000 are still readable?

0 Kudos
1,357 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

maybe this is the reason:

lukaszadrapa_0-1613490426280.png

 Regards,

Lukas

 

0 Kudos
1,418 Views
bobpaddock
Senior Contributor III


"I am just trying to disable reading the program from JTAG/SWD.

Ok so this happens with Jlink edu mini only."

I'm guessing that is to prevent a beginning student from shooting themselves in the foot and bricking their device.

The new NXP MCU-Link is around the same price point as the EDU Mini.

We need to get more parts supported with it, if possible.

 

 

0 Kudos