FlexCan RxIndication how to called by a Can ISR for S32G3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

FlexCan RxIndication how to called by a Can ISR for S32G3

跳至解决方案
1,233 次查看
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 项奖励
回复
1 解答
1,213 次查看
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 项奖励
回复
1 回复
1,214 次查看
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 项奖励
回复