AnsweredAssumed Answered

MKL28 How to disable NMI_b on PTA4

Question asked by M I on Sep 17, 2019
Latest reply on Sep 18, 2019 by Mark Butcher



We have a problem on POR of MKL28 due to newer HW circuit connected to its pin 38 (PTA4) which is causing NMI on power-up & gets stuck in while(1){} loop.   That's because by default PTA4 is configured as ALT7 or "NMI_b" & MCU could be detecting a low input (-NMI) signal on that pin from the HW ckt which enables NMI.


Otherwise, if bootup reached my firmware, PTA4 will be assigned as ALT1, normal GPIO/output.


I've done some readings and from MKL28Z512V datasheet, page 72, I have do 2 things to disable NMI:

1.  remap NMI interrupt handler to other pin function (normal FW will do that).

2.  Disable NMI function by clearing FOPT[NMI_DIS] bit to zero which will take effect on next POR.


I found this 2013 post that shows how to disable NMI inside CodeWarrior IDE(?) for KL15.

(See image re-shown here below)


Does anyone know how I can do the same inside MCUXpresso for KL28 MCU?

Or better, how do I do steps 1 and 2 stated above in code?


I don't see any SDK example on this matter.


Thanks for the help.




This is for MKL15 MCU: