MIMXRT1060-EVKB CAN related question

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

MIMXRT1060-EVKB CAN related question

659件の閲覧回数
niz
Contributor III

Hello 

I have a question about the CAN driver. 

I followed the SDK CAN examples and try to send some CAN message out via the API : 

"FLEXCAN_TransferSendBlocking"

I can send out the CAN messages I want, however, when I stop the CAN bus simulation, looks like the the driver stucks at a while loop: 

"while (0U == FLEXCAN_GetMbStatusFlags(base, u64flag << mbIdx))"

and it blocks all the other part if the software. 

If the CAN message is not acknowledged, it will have the same issue  I think. 

In our application, we need to send out the CAN message periodically,  and we need this blocking API to make sure the CAN sending out. I tried to set up the flag in the CAN bus error handling interrupt to prevent calling the CAN transfer function, however, it still stuck at that while loop sometimes, which can cause the "bricked" board. 

Is there any way we can handle this situation? 

 

Thanks a lot for your help 

ラベル(1)
0 件の賞賛
返信
1 返信

627件の閲覧回数
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @niz,

The function "FLEXCAN_GetMbStatusFlags(base, u64flag << mbIdx)" gets the interrupt flag of a given Msg Buffer.

One solution could be to clear the MbStatus (FLEXCAN_ClearMbStatusFlags(base, u64flag << mbIdx)) in order to bypass the while loop.

Please update me if any doubt arises.

Best regards, Julian

0 件の賞賛
返信