Solved
stm32f0xx_hal_can.h bug found, please fix it
Hello friends,
I have been seeing the same bug in stm32f0xx_hal_can.h for some time, whenever I start a new project I correct it, but I would like you to leave it corrected to avoid correcting it each time I start a new project.
The bug prevents to send an address in extended format.
On line 1250, in the function:
HAL_StatusTypeDef HAL_CAN_AddTxMessage(CAN_HandleTypeDef *hcan, const CAN_TxHeaderTypeDef *pHeader, const uint8_t aData[], uint32_t *pTxMailbox)
replace the following line:
hcan->Instance->sTxMailBox[transmitmailbox].TIR = ((pHeader->ExtId << CAN_TI0R_EXID_Pos) | pHeader->IDE | pHeader->RTR);
by the following:
hcan->Instance->sTxMailBox[transmitmailbox].TIR = ((pHeader->ExtId << CAN_TI0R_EXID_Pos)|(pHeader->IDE<<<2)|pHeader->RTR);
