[L431][HAL][CAN] Cannot force no ACK error in CAN handling
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-01-31 3: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);
}
}
Labels:
- Labels:
-
CAN
-
STM32Cube MCU Packages
-
STM32L4 series
This discussion is locked. Please start a new topic to ask your question.
0 REPLIES 0
