FlexCan RxIndication how to called by a Can ISR for S32G3

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

FlexCan RxIndication how to called by a Can ISR for S32G3

Jump to solution
776 Views
vsong
Contributor II

My example is based on "Can_example_S32G399A_M7".  

Autosar Can Driver is used as in the example.

FlexCan0 and FlexCan1 are used with external loop.  Can rx and tx interrupt are used instead of polling.

vsong_0-1697077446648.png

I would like the Can ISR will ultimately call CanIf_RxIndication. which its call hierarchy is show as below.  the callback in Flexcan_aCtrlConfigPB_VS_0[2] is with the declaration as:

void Can_CommonIrqCallback(uint8 u8Instance,
Flexcan_Ip_EventType event,
uint32 u32buffIdx,
const Flexcan_Ip_StateType *driverState
)

Call Hierarchy is as below:

vsong_1-1697077781630.png

 

In main.c, I map the ISR CAN0_ORED_0_7_MB_IRQn to CAN0_ORED_0_7_MB_IRQHandler

vsong_2-1697077896537.png

 

 

My question is:

How does the "CAN0_ORED_0_7_MB_IRQHandler" call "Can_CommonIrqCallback" in turn to call "CanIf_RxIndication"?

is there an easy way to configure the peripherals in  MCAL?  Or I have to modify the code to bridge the CAN0_ORED_0_7_MB_IRQHandler to Can_CommonIrqCallback?  and where is the best place?  Do you have any sample code?

I attached please find my zip code.

Thanks,

Vivian

 

 

 

0 Kudos
Reply
1 Solution
756 Views
vsong
Contributor II

Please ignore my previous question.

This morning I test the code, and the Rx_Indication and Tx_confirmation are called after I installed the CAN0_ORED_0_7_MB_IRQHandler to CAN0_ORED_0_7_MB_IRQn

Further reading the code find that in FlexCAN_lp.c, it call state->callback which will ultimately call the Rx_indication and Tx_confirmation.

vsong_0-1697122374409.png

 

Sorry to post here and waste your time.

View solution in original post

0 Kudos
Reply
1 Reply
757 Views
vsong
Contributor II

Please ignore my previous question.

This morning I test the code, and the Rx_Indication and Tx_confirmation are called after I installed the CAN0_ORED_0_7_MB_IRQHandler to CAN0_ORED_0_7_MB_IRQn

Further reading the code find that in FlexCAN_lp.c, it call state->callback which will ultimately call the Rx_indication and Tx_confirmation.

vsong_0-1697122374409.png

 

Sorry to post here and waste your time.

0 Kudos
Reply