How to close the Flexcan's "auto busoff recovery" function?

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

How to close the Flexcan's "auto busoff recovery" function?

Jump to solution
1,559 Views
cheney
Contributor III

Dear support team:

     To support the busoff recovery strategy, I want to close the flexcan auto busoff recovery. But i can't find the API or PE_Expert configuration to close this function. Is there any way to close this function? 

0 Kudos
1 Solution
1,302 Views
alexandrunan
NXP Employee
NXP Employee

Hello, 

Thank you for sharing the code, we will analyze if will include this feature in the next releases.

BR,

Alexandru Nan 

View solution in original post

0 Kudos
3 Replies
1,302 Views
alexandrunan
NXP Employee
NXP Employee

Hello,

The disable of BusOFF Auto recovery is not supported by CAN driver from S32SDK, but if you want to do it this can be done by setting the CANx->CTRL1[BOFFREC] to 1.  

BR,

Alexandru Nan

0 Kudos
1,302 Views
cheney
Contributor III

Hi, Alexandru:

    I hope the SDK can supply this api in the following version.

    Now I add the following code in the SDK to support this function.

    flexcan_driver.h: 

/*! @brief FlexCAN busoff recovery type
* Implements : flexcan_boffrec_type_t_Class
*/
typedef enum {
FLEXCAN_BOFFREC_AUTO = 0U, /*!< Automatic recovering from Bus Off state according to CAN2.0B. */
FLEXCAN_BOFFREC_MANUAL = 1U /*!< Manual recovering from Bus Off state. */
} flexcan_boffrec_type_t;

    flexcan_hw_access.h:

/*!
* @brief Selects the busoff recovery type.
*
* @param base The FlexCAN base address
* @param type The FlexCAN recovery type
*/
static inline void FLEXCAN_SelectBoffRecType(CAN_Type * base, flexcan_boffrec_type_t type)
{
base->CTRL1 = (base->CTRL1 & ~CAN_CTRL1_BOFFREC_MASK) | CAN_CTRL1_BOFFREC(type);
}

0 Kudos
1,303 Views
alexandrunan
NXP Employee
NXP Employee

Hello, 

Thank you for sharing the code, we will analyze if will include this feature in the next releases.

BR,

Alexandru Nan 

0 Kudos