How to configure NMI in S32KEA128
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need example software for How to configure NMI in S32KEA128, the microcontroller straightly restarts when it reaches the instruction that does either the NMI interrupt enable or the pin mux configuration. I've tried many things but I get always the same result.
Any Help or example would be appreciated
thank you


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I suppose that you use S9KEA128 instead of S32Kea128.
For the S9KEA128, the PTB4 is the NMI pin. while You have to set the
SIM_SOPT0[NMIE] bit.
BTW, there is api function in start_xxx.c in project created by MCUXPresso tools, which declares the NMI_Handle(void)
void NMI_Handler(void)
You have to fill the function in the NMI_Handle()
void NMI_Handler(void)
{
//toggle LED
__asm("nop");
}
Hope it can help you
BR
XiangJun Rong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI,
i tried the below code but its not working, the register NMIE bit is not updated even after updating it, i gave a breakpoint and tested it, kindly clarify (Note: i used S9KEA128AML )
gpio_port_b_input_init(pin_4);
SIM->SOPT0 |= SIM_SOPT0_NMIE_MASK; // Set the NMI enable bit
NVIC_EnableIRQ(NonMaskableInt_IRQn); // Enable NMI in the NVIC


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Pls try to just use the code:
//gpio_port_b_input_init(pin_4);
SIM->SOPT0 |= SIM_SOPT0_NMIE_MASK; // Set the NMI enable bit
NVIC_EnableIRQ(NonMaskableInt_IRQn); // Enable NMI in the NVIC
comment the line:
//gpio_port_b_input_init(pin_4);
Pls have a try
BR
XiangJun Rong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
i tried but not able to enable the bit
SIM->SOPT0 |= SIM_SOPT0_NMIE_MASK; // Set the NMI enable bit
NVIC_EnableIRQ(NonMaskableInt_IRQn); // Enable NMI in the NVIC


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
It appears that you do not need do anything, just connect the PTB4 to a low voltage, the ISR of NMI will be entered.
Pls check the ticket
https://community.nxp.com/t5/Kinetis-Microcontrollers/KEAZN16-NMI-problem-at-startup/m-p/599475
Hope it can help you
BR
XiangJun Rong
