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
已解决! 转到解答。