CAN Code in Interrupt Mode

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

CAN Code in Interrupt Mode

2,635 Views
Dilip1441
Contributor I

Hi,

I'm Using the can_pal_s32k144 Example Code.

Actually the code is in Polled Mode,

I want to make it as Interrupt Mode(When ever the CAN Message Received then the Control need to go to CAN IRQ)

Also please suggest the What are the Changes required to make it works on interrupt mode.

 

Thank you.

0 Kudos
Reply
3 Replies

2,625 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

driver is always using CAN interrupt during receiving/transmitting. You can use callback function to have indication interrupt was called. You can refer e.g to https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K144-FlexCAN-TX-RX-Error-ISR-test-S32DS2.... It uses flexcan driver. Can_pal will be quite similar, there is less events possible and no error callback.

BR, Petr

0 Kudos
Reply

2,620 Views
Dilip1441
Contributor I

Hi,
Can you please share the Process and Configuration for Enabling the CAN Receiving Interrupt in can_pal_s32k144 Example Code

[When ever the Data Received over the CAN Bus then Control need to go to the CAN IRQ]

0 Kudos
Reply

2,615 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

as I wrote, no setting is needed for enabling interrupt for CAN SDK driver. The driver enables the interrupts for the corresponding CAN module. You can put breakpoint into FLEXCAN_IRQHandler within flexcan_driver.c file. This will be entered if CAN_Receive is called and message comes and match with configured one.

BR, Petr

0 Kudos
Reply