cancel
Showing results for 
Search instead for 
Did you mean: 

BUG in bxCAN HAL

AT
Associate

I'm using

STM32Cube FW_F7 V1.15.0

There is a bug in stm32f7xx_hal_msp.c which prevents reinitialization of CAN1

void HAL_CAN_MspInit(CAN_HandleTypeDef* hcan) {

....

  HAL_RCC_CAN1_CLK_ENABLED++;

  if(HAL_RCC_CAN1_CLK_ENABLED==1){

   __HAL_RCC_CAN1_CLK_ENABLE();

  }

....

}

and then there is no decrement of HAL_RCC_CAN1_CLK_ENABLED in

void HAL_CAN_MspDeInit(CAN_HandleTypeDef* hcan)

{

  /* Peripheral clock disable */

  __HAL_RCC_CAN1_CLK_DISABLE();

}

If you try to init Can1, then deinit It and then it won't init again

1 REPLY 1
AT
Associate

When you disable CAN1, the clock is disabled and never enabled again