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