You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the SparkFun CAN485 in vehicles. After a few days, the CAN transmission stops working. I have determined that this is because there are no more free Mobs.
In my application, I'm sending 3 different CAN frames. For sending, I have created a helper:
void canTx(st_cmd_t* cmd) {
switch (cmd->status) {
case MOB_TX_COMPLETED:
case STATUS_CLEARED:
break;
default:
Serial.print(F("CAN TX error: "));
Serial.println(cmd->status);
break;
}
/* Send to CAN */
cmd->ctrl.rtr = 0; // Set rtr bit
cmd->cmd = CMD_TX_DATA;
// The command will not be accepted if no free MObs.
// cmd->status = MOB_NOT_REACHED, and we will retry next time
if (can_cmd(cmd) != CAN_CMD_ACCEPTED) {
Serial.println(F("CAN TX command refused"));
}
}
For all 3 frames, sending is then done as:
switch (can_get_status(&NmtTX)) {
case CAN_STATUS_COMPLETED:
case CAN_STATUS_ERROR:
canTx(&NmtTX);
}
I'm sending once every 4 seconds, and in the log I'm looking at right now, the first MOB was "lost" after 125 minutes, or about after ~1900 transmissions. The second MOB was lost after additional 655 minutes. So it is fairly rare, but apparently there is some kind of race condition or cornercase. Any ideas?
The text was updated successfully, but these errors were encountered:
I'm using the SparkFun CAN485 in vehicles. After a few days, the CAN transmission stops working. I have determined that this is because there are no more free Mobs.
In my application, I'm sending 3 different CAN frames. For sending, I have created a helper:
For all 3 frames, sending is then done as:
I'm sending once every 4 seconds, and in the log I'm looking at right now, the first MOB was "lost" after 125 minutes, or about after ~1900 transmissions. The second MOB was lost after additional 655 minutes. So it is fairly rare, but apparently there is some kind of race condition or cornercase. Any ideas?
The text was updated successfully, but these errors were encountered: