Closed TuEmb closed 23 minutes ago
Hello, thank you for your report. ~Please include which esp-hal version you're using.~ Current git main seems affected.
Yes, current latest main branch also occurs. I also tested with esp-hal 0.20.1
. I just added version 0.20.1
on description
Bug description
Twai driver crashes with invalid DLC. I'm using ESP32-S3 to receive CAN packets using
embassy-twai
example, and sometimes I encounter this error.From my debugging, this issue occurs when TWAI receives a frame with DLC > 8 (which is unexpected because my system uses Basic CAN, where no frame should have DLC > 8). The issue is difficult to reproduce since it randomly occurs after 30 minutes or more. I will continue debugging to identify the root cause.
Do you guys have any ideas with that case ?
To Reproduce
T.B.D
Expected behavior
We need to handle the case where DLC is greater than 8 because it's possible. I checked esp-idf, and they handle the DLC by adding a bit to indicate DLC_NON_COMP in their TWAI frame struct. Therefore, I suggest adding the following:
Environment