Passive Error flag - possible bug
ISO 11898-1 2015 states:
Passive error flags initiated by receivers shall not be able to prevail over any activity on the bus. Therefore, error-passive receivers shall always wait for 6 subsequent equal bits after detecting an error condition. The passive error flag is complete when these 6 equal bits have been detected.
This is currently not the case with CTU CAN FD. Error passive receivers who transmitt passive error flag will simply go on, transmitt passive error flag and after passive error flag wait for recessive bit (as also with Active Error flag). No counting of 6 consecutive bits of equal value is done! Also, ISO compliance test which tests this (7.5.1) does not reveal this issue, because it super-imposes passive error flag with active error flag. Therefore CTU CAN FD will finish passive error flag sooner than it has detected 6 consecutive bits of equal polarity, but it will wait on recessive bit before proceeding with error delimiter. So the incorrect behavior is not revealed by the test.
If we consider following: Error passive CTU CAN FD detects error as receiver and transmitts passive error flag. No other nodes see any error, so they continue transmitting. No bit error is detected by CTU CAN FD, since reception of dominant bits during passive error flag does not cause bit error. CTU CAN FD finishes its passive error flag and detects recessive bit in coincidence with some transmitted bit by other nodes. Therefore CTU CAN FD proceeds to error delimiter! Other nodes are still in their regular frame transmission. During error delimiter, CTU CAN FD will detect form error, because other nodes will transmit at least one dominant bit due to bit stuffing. So CTU CAN FD will restart next passive error flag and have un-wanted increments of REC!
Note: Probably 7.5.5 will detect this issue!