2023-01-31 03:36 AM
HI!
I'm trying to impelemnt watchdog on my CAN devices, but i cannot force CAN error for testing.
hcan1->ErrorCode is always 0 value, even if i disconnect CAN and no device are acknowledging message(no ack have its own error code in HAL).
I see on oscilloscope, theres no ACK. Why i cant get this error?
there's the way im sending frame. And frame is sending every time(see it on oscilloscope)
if (!HAL_CAN_IsTxMessagePending(&hcan1, canTxMailbox)
&& HAL_CAN_GetTxMailboxesFreeLevel(&hcan1) > 0) {
if (HAL_CAN_AddTxMessage(&hcan1, canTxHeader, canTxData,
&canTxMailbox) != HAL_OK) {
Error_Handler();
} else {
HAL_IWDG_Refresh(&hiwdg);
}
}