i am working with a STM32f103 with the integrated CAN controller and i use the std. periph library.
In the function
the entire CAN_MSR register will be overwritten but not the ERRI bit.
/* Clear CAN_MSR_ERRI (rc_w1) */
CANx->MSR = CAN_MSR_ERRI;
/* Note : the corresponding Flag is cleared by hardware depending
of the CAN Bus status*/
CAN_MSR_ERRI is 0x0004;
In the reference manual at bit descriction of ERRI of the CAN_MSR register i can read
"This bit is cleared by software". An in the code documentation of the std. per. lib. is also written
Is this a bug? Can i use the function CAN_ClearITPendingBit(CAN1, CAN_IT_BOF);
in the BusOff ISR?