Hi team,
Here's an issue from the customer may need your help:
The Dcan is stuck frequently. Added a sentence to reset can at polling time:
//===================================================================
status_err = CAN_getStatus(CANA_BASE);
temp1= status_err & CAN_STATUS_BUS_OFF;
temp2= status_err & CAN_STATUS_EWARN ;
temp3= status_err & CAN_STATUS_EPASS ;
if( (temp1==CAN_STATUS_BUS_OFF) || (temp2== CAN_STATUS_EWARN) || ( temp3== CAN_STATUS_EPASS) )
{
CAN_Reset(CANA_BASE);
//CAN_enableController(CANA_BASE);
}
//===================================================================
Can_Reset(CANA_BASE); is a self-encapsulated function that supports the SWR to reset can, but the fault still remains; So checking it with the simulation, it's find the init bit of CAN_CTL, and then add CAN_enableController(CANA_BASE); to reset the init bit.
However, after reproducing the fault, it is found that the EWarn and EPass bits of CAN_ES are set and that the CAN_RP is set inside CAN_ERRC. Can_REC is full (0x7F). The way to reproduce this issue is to set the can baud rate to 500 k, then drop a packet at 1000 K, and then return. It's find that can cannot working anymore.
The customer would like to know how to avoid such issue? And they also guess Can not work should be related to the CAN_ERRC counter overflow. PMD of CAN_CTL is 0101, that is Parity function disabled.
Could you help check this case? Thanks.
Best Regards,
Cherry