How to configure NMI in S32KEA128

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

How to configure NMI in S32KEA128

1,308 Views
Arunn
Contributor I

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

0 Kudos
Reply
5 Replies

1,288 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

xiangjun_rong_0-1706758477881.png

xiangjun_rong_1-1706758629233.png

 

 

0 Kudos
Reply

1,215 Views
logapriya
Contributor I

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

0 Kudos
Reply

1,198 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply

1,196 Views
logapriya
Contributor I

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

 

0 Kudos
Reply

1,193 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply