I am having trouble trying to set the SEC bits,
I have set the FSEC to 0xF9 on startup file
I inspected the resulting binary to be correct
0xF9 should result to this:
After flashing that binary i read the memory and it's otherwise correct, but SEC bits doesn't get set?
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
Solved! Go to Solution.
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.
The same exact behavior happens with JLink BASE Compact also.
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?
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?
Hi,
maybe this is the reason:
Regards,
Lukas
"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.