We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5f0ae73 commit e56a140Copy full SHA for e56a140
ports/stm/common-hal/canio/CAN.c
@@ -197,7 +197,15 @@ canio_bus_state_t common_hal_canio_can_state_get(canio_can_obj_t *self) {
197
198
void common_hal_canio_can_restart(canio_can_obj_t *self) {
199
if (!common_hal_canio_can_auto_restart_get(self)) {
200
- HAL_CAN_Start(&self->handle);
+ // "If ABOM is cleared, the software must initiate the recovering
201
+ // sequence by requesting bxCAN to enter and to leave initialization
202
+ // mode."
203
+ self->handle.Instance->MCR |= CAN_MCR_INRQ;
204
+ while ((self->handle.Instance->MSR & CAN_MSR_INAK) == 0) {
205
+ }
206
+ self->handle.Instance->MCR &= ~CAN_MCR_INRQ;
207
+ while ((self->handle.Instance->MSR & CAN_MSR_INAK)) {
208
209
}
210
211
0 commit comments