Setting FTFA_FOPT with KDS 3.2.0 and OpenOCD?

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

Setting FTFA_FOPT with KDS 3.2.0 and OpenOCD?

Jump to solution
1,467 Views
mattsarnoff
Contributor I

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?

Labels (1)
0 Kudos
1 Solution
1,068 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
4 Replies
1,068 Views
steverhodes
Contributor I

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.

0 Kudos
1,068 Views
mattsarnoff
Contributor I

Thank you, Alice. I used a J-Link interface and the flash configuration was programmed correctly.

0 Kudos
1,068 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Sarnoff,

OK , welcome !

BR

Alice

0 Kudos
1,069 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

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!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos