Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions drivers/can/can_mcan.c
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,16 @@ int can_mcan_send(const struct device *dev,
return -ENETUNREACH;
}

if (frame->fd && (can->cccr & CAN_MCAN_CCCR_FDOE) == 0) {
LOG_ERR("fd flag set without fd mode enabled.");
return -EINVAL;
}

if (frame->brs && (can->cccr & CAN_MCAN_CCCR_BRSE) == 0) {
LOG_ERR("brs flag set without fd brs mode enabled.");
return -EINVAL;
}

ret = k_sem_take(&data->tx_sem, timeout);
if (ret != 0) {
return -EAGAIN;
Expand Down