Stuff counter when SOF is not transmitted
When CTU CAN FD joins transmission as a result of sampling Dominant bit in third bit of Intermission or during Bus idle, it does not transmitt SOF, this is fine and according to standard.
But it does not account this (received) SOF in Counter of equal consecutive bits in Bit Stuffing module. Therefore if CAN frame with first 5 bits of ID dominant is transmitted, transmitter which joined the communication (without SOF), inserts Stuff bit after 5 bits of ID. Other transmitter which did transmitt SOF, will insert Stuff bit after 4 bits of ID and therefore detect Stuff Error on 5th bit of ID.
This behaviour is OK according to standard and there is an exception that Stuff bit during arbitration shall not increment error counters. Question is, should we implement some workaround on top of existing standard @pisa ? @beranj25 ? @jnovak ?