AnsweredAssumed Answered

Setting FTFA_FOPT with KDS 3.2.0 and OpenOCD?

Question asked by Matt Sarnoff on Jan 13, 2017
Latest reply on Oct 3, 2017 by Steve Rhodes

I am using a Kinetis KL16 and attempting to clear the NMI_DIS bit in the FTFA_FOPT byte. I have modified my startup_MKL16Z4.S file like so:


/* Flash Configuration */
.section .FlashConfig, "a"
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.long 0xFFFFFFFF
.byte 0xFE /* FSEC */
.byte 0xFB /* FOPT; disable NMI */
.byte 0xFF /* reserved */
.byte 0xFF /* reserved */


I am using "GDB OpenOCD Debugging" to program the chip. But it looks like these values are not being written. If I reset the board and inspect address 0x40D it shows 0xFF, not 0xFB.


How can I configure my project/OpenOCD to write the correct flash configuration values?