Guidance on Using FlexCAN_Ip_ManualBusOffRecovery()

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

Guidance on Using FlexCAN_Ip_ManualBusOffRecovery()

385件の閲覧回数
saishanfi
Contributor II

Hi Team,  

I have tested bus-off recovery with the following setup and need some clarification

In EB configuration, I selected Interrupt mode for bus-off recovery and disabled automatic bus-off recovery.

When I shorted CANL and CANH, the bus-off interrupt was triggered and handled via the Can_43_FLEXCAN_ProcessBusOffInterrupt()[SW32K3_S32M27x_RTD_4.4_4.0.0_P24 package] API.

For recovery, I periodically called the FlexCAN_IP_ManualBusOffRecovery() API.

During this test, I noticed that even though automatic bus-off recovery was disabled, the condition check inside the manual recovery API failed. 

Could you please guide me the procedure for using FlexCAN_Ip_ManualBusOffRecovery().

 

Thanks & Regards,

Saishanfi

 

0 件の賞賛
返信
2 返答(返信)

342件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

do not know HLD implementation much, but I think it does not offer API for doing manual recovery and you should not call low level function directly. Typically in AUTOSAR implementaitons user is going through via Can_SetControllerMode().

So implement the Can_ControllerBusOff() callback in your application and use Can_SetControllerMode() to transition the controller to CAN_T_STOP and then back to CAN_T_START after recovery.

BR, Petr

0 件の賞賛
返信

336件の閲覧回数
saishanfi
Contributor II

Hi @PetrS,

 

I have written a stub for manual Bus-Off recovery, and if recovery happens, I put the CAN controller into START mode using Can_43_FLEXCAN_setControllerMode(). However, recovery does not happen as expected.

Steps followed:

 

  • EB configuration: Interrupt mode for Bus-Off recovery enabled, automatic Bus-Off recovery disabled.

  • Shorted CANH and CANL → Bus-Off interrupt triggered and handled via Can_43_FLEXCAN_ProcessBusOffInterrupt() and controller mode was STOP.

  • Manual recovery stub uses a 10 ms recovery timer.

Observed behavior:

  • Shorted CANH/CANL for 3 seconds, then restored the bus.

  • After restoring:

    • ESR1[FLTCONF] still shows Bus-Off.

    • ESR1[SYNCH] is set (FlexCAN is synchronized to the CAN bus).

Questions:

  1. After reconnecting CANH and CANL, recovery does not happen. When does ESR1[FLTCONF] clear? Does TEC need to drop below 256, or is it cleared automatically once the bus is restored?(In manual recovery mode)

  2. Before putting the CAN controller into START mode, how can I check if the bus is ready to join or still in Bus-Off? Which bit should I check?

Could you please support on this?

 

Thanks &Regards,

Saishanfi

 

0 件の賞賛
返信