How to configure NMI in S32KEA128

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to configure NMI in S32KEA128

1,068件の閲覧回数
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 件の賞賛
返信
5 返答(返信)

1,048件の閲覧回数
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 件の賞賛
返信

975件の閲覧回数
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 件の賞賛
返信

958件の閲覧回数
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 件の賞賛
返信

956件の閲覧回数
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 件の賞賛
返信

953件の閲覧回数
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 件の賞賛
返信