From 9478931d69ee3921ed86b87873057e71a70b3d96 Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Wed, 12 May 2021 11:10:23 +0200 Subject: [PATCH] Fix FDCAN incorrect FIFO acknowledgment Fix incorrect way of acknowledging FIFO processing. Old code ORed old value of register with index of FIFO buffer just processed, which generated invalid value for acknowledge. This caused FIFO to repeatedly returning same content. Both fdcan_receive() and fdcan_release_fifo were affected. --- lib/stm32/common/fdcan_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stm32/common/fdcan_common.c b/lib/stm32/common/fdcan_common.c index 80245a0e..be582e82 100644 --- a/lib/stm32/common/fdcan_common.c +++ b/lib/stm32/common/fdcan_common.c @@ -609,7 +609,7 @@ int fdcan_receive(uint32_t canport, uint8_t fifo_id, bool release, uint32_t *id, } if (release) { - FDCAN_RXFIA(canport, fifo_id) |= get_index << FDCAN_RXFIFO_AI_SHIFT; + FDCAN_RXFIA(canport, fifo_id) = get_index << FDCAN_RXFIFO_AI_SHIFT; } return FDCAN_E_OK;