S32DS for ARM 2.2 - CAN busoff detection

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

S32DS for ARM 2.2 - CAN busoff detection

1,175 次查看
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,077 次查看
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,077 次查看
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,077 次查看
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 项奖励