S32DS for ARM 2.2 - CAN busoff detection

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

S32DS for ARM 2.2 - CAN busoff detection

1,122件の閲覧回数
xu_wenming
Contributor II

Hello,

If an error callback function is installed via FLEXCAN_DRV_InstallErrorCallback, it enables error interrupts (internal error, rx warning, tx warning, busoff). However, there's only one interrupt handler FLEXCAN_Error_IRQHandler, it calls error_callback function with event type FLEXCAN_EVENT_ERROR. 

I don't know the root cause why the error interrupt is triggered. 

If I want to get busoff status of the CAN bus, what can I do to implement it? 

At the same time, if I want to get the internal error status, how do I distinguish the INT_ERR and INT_BUSOFF? 

BRs,

Matthew Xu

ラベル(1)
タグ(3)
0 件の賞賛
3 返答(返信)

1,024件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hello 文明 徐,

To generate the bus-off error the easiest way to do this is to send a message to an ID that is not in the network after some tries and error counter reaches 255 the bus-off condition will be triggered.

Also, in the ESR register the different errors that the module register, you could check the description at the following section in the reference manual:

55.4.2.9.4 Fields

Best Regards,

Alexis Andalon

0 件の賞賛

1,024件の閲覧回数
xu_wenming
Contributor II

Hello, 

It seems that I didn't make the question very clear.

I'm not generating the bus-off error, I need to detect the error when bus-off condition is triggered. 

BRs,

Matthew Xu

0 件の賞賛

1,024件の閲覧回数
Alexis_A
NXP TechSupport
NXP TechSupport

Hello 文明 徐,

The flags in the ESR1 are clear after calling the callback, so if you check the BOFFINT flag in the callback you should be able to identify the bus off event.

Best Regards,

Alexis Andalon

0 件の賞賛