Dear support team:
When we use FLEXCAN_DRV_AbortTransfer to abort the CAN message transmission, our routine is stuck in the while loop.
The description of abort process in RM is showed below:
It means an interrupt is generated when ABORT code is write to register.
Does it means that a interrupt is generated after calling FLEXCAN_AbortTxMsgBuff? If so, the interrupt routine will be processed, and the IFlag will be cleared in the interrupt, the code will stuck in the while loop.
Please help me confirm the solution.
SDK version: RTM3.0.0
Best regards!
Cheney
Solved! Go to Solution.
Hello Cheney,
The driver function "FLEXCAN_DRV_AbortTransfer" is doing FLEXCAN_CompleteTransfer should disable the interrupt before issue the abort operation code. Can you check if is doing ok the disable of the interrupt ? Maybe something else is reactivating it. Can you check if before execution of "FLEXCAN_AbortTxMsgBuff" if the IMASK register corresponding bit for mb_idx selected for abort is cleared ?!
Hello Cheney,
The driver function "FLEXCAN_DRV_AbortTransfer" is doing FLEXCAN_CompleteTransfer should disable the interrupt before issue the abort operation code. Can you check if is doing ok the disable of the interrupt ? Maybe something else is reactivating it. Can you check if before execution of "FLEXCAN_AbortTxMsgBuff" if the IMASK register corresponding bit for mb_idx selected for abort is cleared ?!
Hi, Alexandru:
Thank you for your reminding, It's exactly the mailbox interrupt is not disabled in FLEXCAN_CompleteTransfer.
Normally the can interrupt is disabled when a CAN message is received. And the new CAN message can not be received anymore unless you recall FLEXCAN_DRV_Receive.
So we think it is a good idea to remove the FLEXCAN_SetMsgBuffIntCmd(base, mb_idx, false) from FLEXCAN_CompleteTransfer. This operation effect the CAN message cancellation.
Best regards!
Cheney
alexandrunan Could give me some help. Pls.
Cheney.
Can you specify on which platform ? and What are the code changes ?! Do you execute in multiple thread Mode ?
Hi, alexandrunan :
Thank you for your response.
It is occurred in S32K144, the code is not executed in multiple thread mode.
First, i disconnect the CAN line to CANoe, and i send a CAN message. Then i use the api FLEXCAN_DRV_AbortTransfer to cancel the message i sent. When the function is executed, it will stuck in the line i showed before.
If i disable the global interrupt or CAN interrupt when i call the function "FLEXCAN_DRV_AbortTransfer", it works fine.
So i want to confirm if the interrupt need be disable when the function FLEXCAN_DRV_AbortTransfer is called.
Best regards!
Cheney