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?
Solved! Go to Solution.
Hello Matt,
Could you please use the PEMicro interface debug or SEGGER J-LINK debug,
it test these two debug mode ,it clear the NMI_DIS bit .
Hope it helps
Have a great day,
Alice Yang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
FYI I had a similar problem. openOCD defaults to protecting the FCF bytes. See the question Kinetis flash support in OpenOCD for options to either disable the protection or supply the values using openOCD's Kinetis flash driver.
Thank you, Alice. I used a J-Link interface and the flash configuration was programmed correctly.
Hello Sarnoff,
OK , welcome !
BR
Alice
Hello Matt,
Could you please use the PEMicro interface debug or SEGGER J-LINK debug,
it test these two debug mode ,it clear the NMI_DIS bit .
Hope it helps
Have a great day,
Alice Yang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------