Hello Maik, On 03.01.22 16:52, Maik Allgöwer wrote:
Imagine the receiver requests a min tx separation time of 2 ms in a control frame. I then sometimes get consecutive frames with the following scheme of timestamps on an externally connected logger .. 0.0 ms : CF#1 2.5 ms : CF#2 4.0 ms : CF#3 .. In this example CF#2 is delayed by .5 ms on the wire while CF#3 is sent .5 ms too early when I look at the delta between CF#2 and CF#3 . To me it seems that, while the messages are put into some tx-queue at the correct time, they are not actually put on the wire at that exact time leading to CF#3 being put on the wire too early.
Yes. The CAN frames are sent with a 'minimum' gap which is defined with STmin, see isotp_tx_timer_handler().
Generally the handling and the sending of the frame is processed - and *then* the offset gap of the current time is added. In your case it should always be *slightly more* than 2ms, which is fine from the STmin specification intention.
The 0.5ms delay of CF#2 is likely introduced on CAN driver level or CAN bus level (arbitration?!).
With a virtual CAN it looks like this: In terminal 1 (STmin = 2ms) $ isotprecv vcan0 -s 123 -d 321 -m 2 In terminal 2 $ isotpsend vcan0 -d 123 -s 321 -D 30 In terminal 3 $ candump vcan0 -td (000.000000) vcan0 321 [8] 10 1E 01 02 03 04 05 06 (000.000030) vcan0 123 [3] 30 00 02 (000.002116) vcan0 321 [8] 21 07 08 09 0A 0B 0C 0D (000.002238) vcan0 321 [8] 22 0E 0F 10 11 12 13 14 (000.002232) vcan0 321 [8] 23 15 16 17 18 19 1A 1B (000.002080) vcan0 321 [4] 24 1C 1D 1E Which fits exactly the expectations. Best regards, Oliver