AnsweredAssumed Answered

stm32f4 Help with CAN_ErrorCallback

Question asked by Sorix on Oct 10, 2015
Latest reply on Nov 2, 2015 by Amel N
Hello.
I have some problem and I can't do anything with it. So, I have CAN bus with two CAN. uP is stm32f407. When is normal work i send data by HAL_CAN_Transmit(&hcan2,5), and  HAL_CAN_Transmit(&hcan1,5). I received them by HAL_CAN_ErrorCallback(CAN_HandleTypeDef* hcan). It  is good until it  not have any error. 

When error occurs then is invoking the errorcallback. Before that is invoked one of the function voidCAN1_SCE_IRQHandler(void)  or void CAN2_SCE_IRQHandler(void). When one time occurs error, then every next time is invoked CAN_SCE_IRQ ,although dont have any error (don't have any errorcode, and every  value REC, TEC and LEC is 0). Who tell me why? I add that, before occurs the first errorcallback, function CAN_SCE is never invoked.

It cause that the main program is stopped, because it's all the time invoked one of the function CAN2_SCE_IRQHandler(void), CAN1_SCE_IRQHandler(void). What i can do?

When i cleared ERRIE, then the CAN2_SCE_IRQHandler is not invoked. So it is something with ESR register. But it is equal to 0.

Outcomes