2020-12-14 07:30 AM
I use hal can modul for STM32F091 MCU. The generated code in the function HAL_CAN_Init (HAL_StatusTypeDef HAL_CAN_Init(CAN_HandleTypeDef *hcan)) try to wake up CAN module from sleep to initialize mode by CLEAR_BIT(hcan->Instance->MCR, CAN_MCR_SLEEP). This results a HAL_CAN_ERROR_TIMEOUT because first another bit should be set: SET_BIT(hcan->Instance->MCR, CAN_MCR_INRQ); By this way the experimented timeout doesn't occur. See: RM0091 A.11.1 bxCAN initialization mode code example
2020-12-14 08:27 AM
Hi @Beppo7
I catch your request. We will investigate this internally and I come back to you as soon as possible.
Bouraoui
2020-12-15 11:32 PM
2020-12-16 02:45 AM
Hi @Beppo7
Thank you for your feedback.
CAN Rx pin must be configured as pullup to ensure CAN Idle bus at high level. As developed in CAN example available in STM32CubeF0 firmware via this path STM32Cube_FW_F0_V1.11.0\Projects\STM32072B_EVAL\Examples\CAN
Bouraoui