AnsweredAssumed Answered

CAN BUS Stress Test

Question asked by Luca Giuliodori on Mar 30, 2018
Latest reply on Apr 6, 2018 by Luca Giuliodori

I'm testing one application with 3 differente device that send a message with random command ID and random data on CAN bus every random timeout: two devices with two STM32L433 nucleo and one with STM32F446 nucleo and with TJA1044T NXP transceivers.
I implemented firmware starting with STMCube (rev. 4.23.0) and added my application code with all corrections that I found in the community.


For first test the command ID random range was between 0 to 50 and the timeout random range was from 10ms to 1s. In this case all work enough fine without errors or packet lost.

In second test I reduced the timeout random range and was between 1ms to 10ms. In this case some errors appear and some packet lost; In particular the most freqeuntly errors was BIT ERROR (BR error).

To stress the application again I reduced the command ID random range to 1 (only command ID 0) and set the timeout to 1ms fixed: every ms all the boards (not sincronized) send the same command ID. In this case the number of errors (BOF, STF, FOR, ACK BR and BD) and lost packets increase a lot.


To evaluate the number of errors and lost packets, I implemented specific counters
that I can read by PC SerialPort when the test is stoped.


The frequency of CAN bus is 1Mbit/s, I calculated the timing by (Tq = 62.5ns, BS1 = 13, BS2 = 2, SJW = 1) and I used a very short cable (about 30cm).


In all tests the number of sent packet by every board are about 160.000.

My question is: is normal this behavior? I didn't found materials in intertet about this.