GPIO Interrupt on S32K148

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

GPIO Interrupt on S32K148

2,908件の閲覧回数
m_mishrikey
Contributor III

Hello, 

I am trying to do something rather similar to what is described here, but so far without success:

Enable GPIO pin interrupt S32K144 MCU 

Example: S32K148 GPIO Interrupt  

Multiple GPIO interrupts 

First, I setup the pins PTD24 and PTD27 as inputs:

pastedImage_8.png

Next, I configure them to interrupt on falling edge:

pastedImage_9.png

In the PEX settings I do not clear the flag, with the intention of doing so manually in the ISR handler.  (side question - I'm a bit confused about this - if you had PEX clear the flag, would that happen immediately after the ISR?)

Next, I create the ISR.  Because there are multiple interrupts, I check the intflags using the SDK calls.  Presently both interrupts take the same action.

pastedImage_1.png

Next, I install the handler, after PINS_DRV_Init().  

I've tried it two ways:

pastedImage_10.png

and also this, with & in front of handler name:

pastedImage_11.png

because some examples I've seen use the & notation.  (side note: I've even tried with the 2nd argument cast to isr_t since that what INT_SYS_InstallHandler expects.)  

Neither approach works unfortunately.  

I'm able to confirm a falling edge on the GPIO pin in question, however the code never triggers the interrupt or calls the handler.  

Additional note - despite the RTOS-like handler naming, I'm not doing anything with RTOS apart from what comes automatically with the PEX/SDK template.  

I wonder if there is something else I am missing.  Examples seem pretty straightforward.    

Thanks

タグ(4)
0 件の賞賛
5 返答(返信)

2,827件の閲覧回数
m_mishrikey
Contributor III

Thanks Robin.  Unfortunately this example doesn't answer any questions (except that the example uses the &function notation). 

Are there any other prerequisites to the interrupt handler getting called, other than installing it, and specifying an interrupt type in the pin settings?

0 件の賞賛

2,827件の閲覧回数
m_mishrikey
Contributor III

Argh.  I made a mistake and was looking at the wrong pin the whole time.  Sorry!

CAN_PAL example is still setup wrong though, someone should check that out.

Thanks

0 件の賞賛

2,827件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Matthew Mishrikey,

I am glad to hear you find out the problem.

Thank you for the report, I'll inform the SDK team about this.

Best Regards,

Robin

0 件の賞賛

2,827件の閲覧回数
m_mishrikey
Contributor III

By the way, the can_pal example project seems to have an error in it. 

BUTTON1 and BUTTON2 are PTC12 and PTC13 in the code, 

however the interrupt settings in PEX are applied to PTC13 and PTC14:

pastedImage_2.png

pastedImage_1.png

0 件の賞賛

2,827件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi Matthew Mishrikey,

Please refer the GPIO interrupt shown in can_pal_s32k148 example.

can_pal_s32k148.png

GPIO interrupt can_pal_s32k148.png

Best Regards,

Robin

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛