NMI_DIS bit in KSDK 2.0

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

NMI_DIS bit in KSDK 2.0

Jump to solution
1,331 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
980 Views
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

View solution in original post

0 Kudos
Reply
2 Replies
980 Views
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 Kudos
Reply
981 Views
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 Kudos
Reply