Skip to content

Commit 46136b3

Browse files
henrikbrixandersenmbolivar-nordic
authored andcommitted
drivers: can: mcux: flexcan: fix handling of failed RX MB reads
Fix handling of failed NXP FlexCAN RX mailbox reads. Instead of re-enabling the RX MB in the ISR, we need to handle a failed RX MB read (e.g. due to a busy MB bit). Signed-off-by: Henrik Brix Andersen <[email protected]>
1 parent 03ac89d commit 46136b3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/can/can_mcux_flexcan.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,8 +731,6 @@ static inline void mcux_flexcan_transfer_rx_idle(const struct device *dev,
731731
function(dev, &frame, arg);
732732

733733
/* Setup RX message buffer to receive next message */
734-
FLEXCAN_SetRxMbConfig(config->base, mb,
735-
&data->rx_cbs[alloc].mb_config, true);
736734
xfer.frame = &data->rx_cbs[alloc].frame;
737735
xfer.mbIdx = mb;
738736
status = FLEXCAN_TransferReceiveNonBlocking(config->base,
@@ -775,6 +773,9 @@ static FLEXCAN_CALLBACK(mcux_flexcan_transfer_callback)
775773
break;
776774
case kStatus_FLEXCAN_RxOverflow:
777775
__fallthrough;
776+
case kStatus_Fail:
777+
/* If reading an RX MB failed mark it as idle to be reprocessed. */
778+
__fallthrough;
778779
case kStatus_FLEXCAN_RxIdle:
779780
mcux_flexcan_transfer_rx_idle(data->dev, mb);
780781
break;

0 commit comments

Comments
 (0)