cancel
Showing results for 
Search instead for 
Did you mean: 

Bug Report in STM32Cube HAL CAN driver.

Palauqui.Georges
Associate II

Hello,

Sorry in advance if I should be posting this elsewhere, but I am sure someone will be able to tell me if I am wrong.

Working with STM32Cube HAL CAN driver, if found a problem in the latest version of F7 driver, but as all STM32 have same BxCAN controler I assume this is the same for all Cube HALs supplied by ST.

In stm32f7xx_hal_can.c, at HAL_CAN_GetRxMessage function :

pHeader->RTR = (CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[RxFifo].RIR) >> CAN_RI0R_RTR_Pos;

I assume the right shift shall not been done in order to have a pHeader->RTR comparable to CAN_RTR_REMOTE in stm32f7xx_hal_can.h :

#define CAN_RTR_REMOTE              (0x00000002U)  /*!< Remote frame */

So the correct line should be :

pHeader->RTR = CAN_RI0R_RTR & hcan->Instance->sFIFOMailBox[RxFifo].RIR;

1 REPLY 1
Imen.D
ST Employee

Hello @Palauqui.Georges​ 

We are aware of this limitation that has impacted all STM32Cube HAL, and it will be fixed in next releases.

Thanks for the report.

Best Regards,

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen