Skip to main content
Alihussain Vohra
Associate III
September 16, 2023
Question

STM32G0B1KxT CAN not working

  • September 16, 2023
  • 1 reply
  • 2134 views

Hi Team,

I am using STM32G0B1KxT and code is successfully uploaded. The code is referred from sample code only still it is not working. Here CAN is CANFD but I am using as classic mode.

I am attaching snippet of CAN part and main.c file. 

 

CAN.PNG

 

This topic has been closed for replies.

1 reply

Tinnagit
Senior II
September 16, 2023

for RX CAN filter, I had use 

 if (HAL_FDCAN_ConfigFilter(&hfdcan1, &sFilterConfig) != HAL_OK)
 {
 /* Filter configuration Error */
 Error_Handler();
 }

and I use HAL_FDCAN_ActivateNotification to activate RX Filter to Interrupt
so I have to get RX message on HAL_FDCAN_RxFifo0Callback by HAL_FDCAN_GetRxMessage and after get those message you should activate it again.

and the other, I'm not sure about baud rate configuration but somehow you can test the register operation on loopback mode.