MCAN on MPC5775B: What to do after CAN bus-off? CAN bus-off recovery strategy?

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

MCAN on MPC5775B: What to do after CAN bus-off? CAN bus-off recovery strategy?

ソリューションへジャンプ
2,144件の閲覧回数
peter_vranken
Contributor IV

Dear NXP Team,

This is the first time I write code for the MCAN device. It is basically working but I
wonder how to handle the bus-off. For other device I know a configuration setting like
"bus-off auto-recovery" and I didn't have to write code for a remedial action. The HW
itself did all what is appropriate to re-sync with the bus and start over.

In the RM of the MCAN device (MPC5775B, section 43), I didn't find any word on bus-off
recovery, neither automatic nor as a how-to-do section. So I wonder what is the right
strategy? As a matter of fact, at the moment, not having coded anything particular, the
device is stuck after intentionally caused errors on the bus.

Would it be sufficient to set and reset the init bit, like this:

/* Demand init mode by setting the bit INIT and wait for acknowledge. */
pCanDevice->CCCR |= M_CAN_CCCR_INIT_MASK;
while((pCanDevice->CCCR & M_CAN_CCCR_INIT_MASK) == 0u)
    ;

/* Leave the init mode and let the device re-synchronize with the bus. We need to wait
for the state transition. */
pCanDevice->CCCR &= ~M_CAN_CCCR_INIT_MASK;
while((pCanDevice->CCCR & M_CAN_CCCR_INIT_MASK) == 1u)
    ;

Or what otherwise to do, after a bus-off has been signaled?

 

Kind regards,

Peter

タグ(3)
0 件の賞賛
返信
1 解決策
2,131件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I think steps are given in the note in PSR register description.

PetrS_0-1679997968255.png

BR, Petr

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
2,132件の閲覧回数
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I think steps are given in the note in PSR register description.

PetrS_0-1679997968255.png

BR, Petr

0 件の賞賛
返信
2,119件の閲覧回数
peter_vranken
Contributor IV
Thanks for your hint. Bus-off recovery is working well now!
0 件の賞賛
返信