S32DS for ARM 2.2 - CAN busoff detection

cancel
Showing results for 
Search instead for 
Did you mean: 

S32DS for ARM 2.2 - CAN busoff detection

116 Views
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

Labels (1)
Tags (3)
0 Kudos
3 Replies

18 Views
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 Kudos

18 Views
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 Kudos

18 Views
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 Kudos