AnsweredAssumed Answered

HAL_CAN_Receive_IT does not handle all sources off interrupts

Question asked by Pierre Pierre on Oct 16, 2017



I work on STM32F412. I have a CAN bus with differents boards connected on it.

I'm using HAL CAN library and I have an issue during transmission when several boards try to transmit on bus at the same time.

CAN1_TX_IRQHandler function is called in loop.


void CAN1_TX_IRQHandler(void)
    HAL_CAN_IRQHandler( &g_hPxbCan );


And I realized that on function HAL_CAN_IRQHandler, some bit in register TSR was not taken into account :

- ALST 0/1/2

- TERR 0/1/2


- LOW 0/1/2/3


So in my case I have the bit ALST0 that is set, but the code on HAL_CAN_IRQHandler don't clear the flag and don't call HAL_CAN_ErrorCallback. So my application code is not aware that the transmit ends with an issue.


Moreover, I also realized that FFIE0 bit in IER register was never set (meaning Fifo Full interrupt is never set).


Do you plan to take into acount all the bit in TSR register and also use Fifo Full interrupt?