From f1277a2233b2613e9245b67bdede54b4d645053b Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 21 Oct 2022 15:45:04 +0200 Subject: [PATCH] stm32/socketcan: fix the EFF flag for received frames --- arch/arm/src/stm32/stm32_can_sock.c | 3 +-- arch/arm/src/stm32f7/stm32_can_sock.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/src/stm32/stm32_can_sock.c b/arch/arm/src/stm32/stm32_can_sock.c index 28898c8704..2a12e1a33b 100644 --- a/arch/arm/src/stm32/stm32_can_sock.c +++ b/arch/arm/src/stm32/stm32_can_sock.c @@ -1207,12 +1207,11 @@ static int stm32can_rxinterrupt_work(struct stm32_can_s *priv, int rxmb) if ((regval & CAN_RIR_IDE) != 0) { frame->can_id = (regval & CAN_RIR_EXID_MASK) >> CAN_RIR_EXID_SHIFT; - frame->can_id &= ~CAN_EFF_FLAG; + frame->can_id |= CAN_EFF_FLAG; } else { frame->can_id = (regval & CAN_RIR_STID_MASK) >> CAN_RIR_STID_SHIFT; - frame->can_id |= CAN_EFF_FLAG; } #else if ((regval & CAN_RIR_IDE) != 0) diff --git a/arch/arm/src/stm32f7/stm32_can_sock.c b/arch/arm/src/stm32f7/stm32_can_sock.c index 133d1caf8a..d479546703 100644 --- a/arch/arm/src/stm32f7/stm32_can_sock.c +++ b/arch/arm/src/stm32f7/stm32_can_sock.c @@ -1231,12 +1231,11 @@ static int stm32can_rxinterrupt_work(struct stm32_can_s *priv, int rxmb) if ((regval & CAN_RIR_IDE) != 0) { frame->can_id = (regval & CAN_RIR_EXID_MASK) >> CAN_RIR_EXID_SHIFT; - frame->can_id &= ~CAN_EFF_FLAG; + frame->can_id |= CAN_EFF_FLAG; } else { frame->can_id = (regval & CAN_RIR_STID_MASK) >> CAN_RIR_STID_SHIFT; - frame->can_id |= CAN_EFF_FLAG; } #else if ((regval & CAN_RIR_IDE) != 0)