cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F1Cube drivers bug

Yannick Dannel
Associate II
Posted on January 16, 2018 at 12:25

Dear,

I am currently using the STM32F1Cube drivers on a STM32F107VC MCU (STM3210C-EVAL board) and I discovered a bug in CAN drivers.

The problem is in the 'stm32f1xx_hal_can.h file on line 379.

#define CAN_FLAG_TXOK2             ((uint32_t)((TSR_REGISTER_INDEX << 8U) | CAN_TSR_RQCP0_BIT_POSITION))  /*!< Transmission OK MailBox2 flag */

When you send a CAN frame, the IRQ (HAL_CAN_IRQHandler) always call CAN_Transmit_IT/HAL_CAN_TxCpltCallback even if the transmission failed. Your never have 'HAL_CAN_ERROR_TXFAIL' as error code.

If you have a CAN configuration with no automatic retransmission without  other device connected on bus CAN and you try to send a CAN frame you never know than you have a transmission error.

This must be

#define CAN_FLAG_TXOK2             ((uint32_t)((TSR_REGISTER_INDEX << 8U) | CAN_TSR_TXOK2_BIT_POSITION))  /*!< Transmission OK MailBox2 flag */

I don' know if it's the good place to report this bug.

Best Regards

1 REPLY 1
Imen.D
ST Employee
Posted on January 16, 2018 at 12:40

Hello

DANNEL.Yannick

,

Thank you for your reported issue.

This wrong define for CAN_FLAG_TXOK2 is confirmed and raised internally to the appropriate team for fix in the coming release.

Best Regards,

Imen.

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