NMI_DIS bit in KSDK 2.0

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

NMI_DIS bit in KSDK 2.0

跳至解决方案
1,931 次查看
matute
Contributor III


Hi, I would like to know how can I disable the NMI_DIS bit on FTFA_FOPT using KDSK 2.0 new API?

 

My problem is that I have a custom board (MKL43Z MCU) and I'm using PTA4 as input, so the NMI Interrupt occurs when it is in low state... Fortunately in this pin I have a dip switch pulled up to manage this problem while I develop my application, but it will be very useful to know how I can solve the NMI interrupt as well.

 

Best Regards

Matías

标签 (1)
0 项奖励
回复
1 解答
1,580 次查看
DavidS
NXP Employee
NXP Employee

Hi Matias,

In KSDK_v2 for the MKL43Z you can make the following change to the default FOPT[NMI] bit setting to disable NMI operation in file startup_MKL43Z4.S:

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF3bFE /* //DES disable NMI */

/*    .long 0xFFFF3FFE */ //DES default

I tested this using the gpio_input_interrrupt_frdmkl43z example.

When running it without modification, set a breakpoint in the NMI_Handler in the same assembly file as mentioned above.

Then without running the code yet, press the SW1 which is the NMI pin.  Once pressed, run the code and it should hit the breakpoint in the NMI_Handler.

Now make modification to code.  Re-compile, re-test and the NMI breakpoint will not occur.

Regards,

David

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,580 次查看
matute
Contributor III

Ok, Thank you David!

It is working fine now, I saw some FTFA_FOPT defines in MKL43Z4.h but I didn't find the way to apply them.

Best Regards

Matias

0 项奖励
回复
1,581 次查看
DavidS
NXP Employee
NXP Employee

Hi Matias,

In KSDK_v2 for the MKL43Z you can make the following change to the default FOPT[NMI] bit setting to disable NMI operation in file startup_MKL43Z4.S:

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF3bFE /* //DES disable NMI */

/*    .long 0xFFFF3FFE */ //DES default

I tested this using the gpio_input_interrrupt_frdmkl43z example.

When running it without modification, set a breakpoint in the NMI_Handler in the same assembly file as mentioned above.

Then without running the code yet, press the SW1 which is the NMI pin.  Once pressed, run the code and it should hit the breakpoint in the NMI_Handler.

Now make modification to code.  Re-compile, re-test and the NMI breakpoint will not occur.

Regards,

David

0 项奖励
回复