2016-02-28 08:43 AM
Hello,
I have a problem with CAN bus on STM32F103TB.I have CAN_ESR register = 0 but still I get bit ERRI in CAN_MSR = 1.If i try clearing it either via code or via debugger it will be set again by hardware.I've searched on lastest datasheet, reference manual and erratas but there is nothing.Any advice? Thanks #can #canbus #stm32f12016-02-28 09:31 AM
Ok, but what is happening externally on the bus, and in your system design and how does that reflect on the status and settings internally?
2016-02-28 10:01 AM
I'm trying to simulate bus faults and handle recovery.
I have only one other device on the bus, and i have ABOM enabled.This is what i'm doing:- i have a loop to send a message every 50ms. on reset everything works fine.- i remove the termination to simulate a fault. The code enters in CAN1_SCE_IRQHandler as expected.- when i restore the termination the transmission does not restart. If i clear ERRIE flag it restarts but ERRI stays true even if TEC reaches zero. That means if i enable again ERRIE bit i get stuck in the interrupt handler even all the fields in CAN_ESR are zero...2016-02-28 10:38 AM
What's in all the other CAN registers and FIFOs, and what is the EC set too?
2016-03-30 01:08 AM
Hi,
the manual is not clear, I had same problem. You shoud clear ERRI flag by writing 1 to it (not writing 0).CAN1.MSR|=(1<<2);
Bye
2016-04-10 02:40 PM