2368455_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2368455_en-US

2368455_en-US

CAN driver recovery

Hello,

I am working on the FlexCAN driver (interrupt mode) in the FRDM-A-S32K344 platform. I want to verify whether the CAN driver supports automatic recovery from CAN bus faults without a system or ignition reset. If this recovery feature exists in SDK version 3.0.0, where is it implemented or reflected in the driver, and where should I check it?

Re: CAN driver recovery

Hi @ganavi1,

As @shep mentioned, the FlexCAN driver from the RTD package can enable the "AutoBus Recovery" feature.

Julin_AragnM_0-1779302922996.png

This is set by default, and no additional settings are required. Once the bit is enabled, FLEXCAN will automatically try to recover from the bus-off state to the normal state (assuming the external conditions that caused the bus-off are removed).

Best regards,
Julián

Re: CAN driver recovery

The S32K FlexCAN register has support for automatic bus-off recovery. I don't have the SDK manual, but you can search thru the relevant section to see if it interacts with the bit described in the reference manual.

Here is the text from the reference manual:

CTRL1 Register
BOFFREC
Bus Off Recovery
Determines how FlexCAN recovers from Bus Off state. If 0, automatic recovering from Bus Off state occurs according to the CAN Specification 2.0B. If 1, automatic recovering from Bus Off is disabled. The module remains in Bus Off state until you write 1 to this field.
If this field becomes 0 before 128 sequences of 11 recessive bits are detected on the CAN bus, Bus Off recovery happens as if this field had never become 1. If this field becomes 0 after 128 sequences of 11 recessive bits occurred, FlexCAN resynchronizes to the bus. It waits for 11 recessive bits before joining the bus.
After this field becomes 0, it can become 1 again during Bus Off, but it will only be effective the next time the module enters Bus Off. If this field becomes 0 when the module is in Bus Off, writing 1 to this field is not effective for the current Bus Off recovery.
See Bus Off in the CAN protocol standard ISO 11898-1:2015 for details.
NOTE
0b - Enabled
1b - Disabled

The default value of the bit is 0, so by default it will perform bus-off recovery automatically.

Re: CAN driver recovery

Here is some error correction feature as below, hope it helps.

Detection and correction of errors in memory read accesses:
—Each byte of FlexCAN memory is associated to five parity bits.
—The error correction mechanism ensures that errors in one bit of this 13-bit word can be corrected (correctable errors).
—Errors in two bits can be detected but not corrected (noncorrectable errors).

Tags (1)
No ratings
Version history
Last update:
a week ago
Updated by: