Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround for stm32can stuck in error passive state (#726)
Under some circumstances the stm32 CAN controller can get stuck in error passive state and never hit bus off state even though there is no other bus participant. This PR changes the queuing and error handling logic to detect this state and drop the transmit queue entries. The specific condition is when there is an operational can transceiver, but there is no other bus participant, meaning that all transmit attempts end up with no-ack error. In this situation the TEC rises to 128, the device goes error passive, but the TEC does not get incremented any further. Removes flag clear statements for error flags in the ESR register, because these flags are not writeable (can not be cleared in software). === * Cancel messages in the queue when we are in error passive mode. * Cancels the transmit queue for both error passive and bus off states. Removes flag clear statements for error flags in the ESR register, because these flags are not writeable (can not be cleared in software).
- Loading branch information