CAN Bus strange signal (solved)
edit: the problem was due to a CAN-master switching baudrates on the fly.
the wrong (slower) timing was detected by the CAN controller causing the interruption of the ongoing transmission.
Hello Community !
I am implementing CAN communication with an inverter and sometimes experience communication failures. The inverter is the only one sharing the bus.
The interface is setup @500kBaud, STM32F407 (revision 2) 100pins, CAN1 (A11,A12) and works fine except getting this strange behavior sometimes, which I can't understand.
I use interrupt driven Receive and cmsis CanTransmit fct.
SCE ISR just clears errors:
CAN1->ESR = (uint32_t)RESET;
CAN1->MSR = CAN_MSR_ERRI;
From that point on the inverter transmits corrupted frames for about 10s until it sort of recovers.
My CAN-Init:
CAN_InitStructure.CAN_TTCM = DISABLE;
CAN_InitStructure.CAN_ABOM = DISABLE;
CAN_InitStructure.CAN_AWUM = DISABLE;
CAN_InitStructure.CAN_NART = ENABLE;
CAN_InitStructure.CAN_RFLM = ENABLE;
CAN_InitStructure.CAN_TXFP = ENABLE;
CAN_InitStructure.CAN_Mode = CAN_Mode_Normal;
CAN_InitStructure.CAN_SJW = CAN_SJW_1tq;
I am a bit new to CAN-Bus so the solution might be very trivial.
I do not understand why the TX-Line is being activated interfering the ongoing transmission with a well shaped pattern.
What did I do wrong and how can the CAN TX line be activated without sending or receiving ? Is this part of the BUS arbitration and what is the condition that forces the CAN controller to behave like that (all queues empty).
Thank you for reading all this !
Tom

