Automotive CAN Bus acting weird (FlexCAN_T4)

Status
Not open for further replies.

Fyod

Well-known member
Hi everyone.

I'm trying to read the CAN data from an automotive part, which is going fine, but I have one weird finding.
Every 6 seconds or so, the CAN data stream stops for about 1 second. I don't think this is standard behavior, I think the CAN controller may be restarting. I can see a slight current drop on its input.
I am sending the example's random message to keep the bus alive, otherwise all communication shuts down.

Code:
    msg.id = random(0x0,0x00);
    for ( uint8_t i = 0; i < 8; i++ ) msg.buf[i] = i + 1;
    Can0.write(msg);

Has anyone seen anything similar before? Is this a matter of sending the wrong keep-alive message? Bad message timing?
Thanks!
 
In my experience you shouldn't need to send anything to "keep the bus alive", you just need to make sure that every message sent is ACK'ed by somebody.
 
It's a "passive" component, a control joystick for the entertainment console.
I do think it makes sense to keep-alive as it has no other way of knowing the state of the car (permanent 12V, gnd, CAN). I don't have access to the car right now to confirm, but in some other cars I've dealt with, a quiet bus meant that many components went to sleep. The entertainment bus may be different to other crucial buses.

I sort of confirmed this by setting the tx message to repeat after 2 seconds and the module goes to sleep between transmissions (almost no current flow).
 
I would generally not recommend sending random stuff on the CAN bus to keep it alive. If the device needs traffic to keep it alive then find out a representative message that would normally be on the bus and just keep sending that. Sending on random IDs might do strange things. But, you have random (0, 0) which means you are always sending on ID 0. This is technically valid to do. You can use ID 0. But, did you really mean to do that?
 
Status
Not open for further replies.
Back
Top