2018-01-06 04:45 AM
I want to send data over CAN1, CAN2 at the same time,
so in the Code simple :
HAL_CAN_Transmit(&hcan1, 50);
HAL_CAN_Transmit(&hcan2, 50) ;so I'm getting situation presented on upper side of the image :
the data CAN2 are send when CAN1 finish transmission.
Is it normal ?
My expectation is that CAN2 will start transmission before CAN1 end transmitting data.
Is it related that CAN1 and CAN2 are sharing some MCU resources ?
my MCU is STM32F413, speed is 10kbps, HAL library,
CAN1,CAN2 are connected to two different physical CAN BUS
regards
#bxcan #hal_can_transmit #stm32f4 #hal #slave #master2018-01-06 06:56 AM
You didn't state if CAN1 and CAN2 are on the same or different buses. If you try to send two transmissions on the same bus at the same time the higher priority message will force the lower priority message (determined by header ID bits) to back off. However on two separate buses yes you can overlap, and this technique is supported in some CAN protocols such as later versions of CANopen.
On a single bus if the first message is past the header the second will not start. If it does you will get a bus error. Messages from two transmitter must be synchronized to start at the same time in order for the priority bit checking to work. This is the primary difference between CAN and similar interfaces such as RS-485, and is central to the whole concept of the short message ID instead of the usual packet header in other networks.
Jack Peacock
2018-01-06 08:20 AM
yes sorry, I didn't mentioned about that.
CAN1, CAN2 are connected to the different physical CAN BUS.
My assumption was, that it should be available send data at the same time . I still cannot find explanation for that.