How to configure a NMI in a S32K116

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

How to configure a NMI in a S32K116

1,479 Views
fernando_usunar
Contributor I

I'm trying to install an external watchdog with a S32K116 microcontroller, with the wdo (watchdog output) connected to the NMI pin (PTD3) but as soon as I enable the NMI interrupt, or I configure the pin as "nmi_b" with the processor expert panel in the pin mux, 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 allways the same result, and I didn't found any example of how to configure a Non Maskable Interrupt.

I'm working with the S32DS and a multilink programmer and the wdo signal makes a falling edge every 7 ms which is time enough to any execution that runs in the microcontroller.

Any help or example would be aprecciated.

Thanks.

Labels (1)
0 Kudos
3 Replies

1,176 Views
fernando_usunar
Contributor I

It does enter in the handler, and it makes a forced debug pause, but it is still not sensible to the nmi pin but directly triggered once the configuration is done.

0 Kudos

1,176 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

The PTD3 pin is routed to BTN0 (SW2) on the S32K116 EVB.

As you can see in the schematic of the board, PTD3 is pulled low.

And so, it triggers NMI when you enable the feature.

Please try this, press the SW2 and then run or step the code.

It will enter the NMI handler when you release the SW2 (falling edge on PTD3).

Regards,

Daniel

0 Kudos

1,176 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Can you add the NMI handler in the main.c?

Does it enter the handler?

void NMI_Handler(void)
{
 __asm__("BKPT");
}

Regards,

Daniel

0 Kudos