Skip to main content
MSzła.1
Associate III
June 12, 2023
Question

Can't receive any CAN data on STM32F303CCT6

  • June 12, 2023
  • 1 reply
  • 1097 views

Hello I tried to receive any CAN signal on my device based on STM32F303CCT6. Maybe you have solution :), CAN pins are remapped on PB9 and PB8 pins by STMCubeMX configurator

Below my code (main.c):

https://pastecode.io/s/7av2ge6m

and my settings in configurator:


_legacyfs_online_stmicro_images_0693W00000dDdRcQAK.png
_legacyfs_online_stmicro_images_0693W00000dDdRhQAK.png
_legacyfs_online_stmicro_images_0693W00000dDdRmQAK.pngI also set CAN RX pull HIGH using the internal pull-up, like in the tutorial https://controllerstech.com/can-protocol-in-stm32/

Thanks for help

This topic has been closed for replies.

1 reply

mƎALLEm
ST Technical Moderator
September 22, 2026

Hello,

Same remark as this post:

You need to avoid low BSx values and need to increase as much as possible  BS1 and BS2 while decreasing the prescaler. You need to take care about the sample point that needs to be at around 87,5%.

hcan.Init.Prescaler = 18;
hcan.Init.TimeSeg1 = CAN_BS1_2TQ;
hcan.Init.TimeSeg2 = CAN_BS2_1TQ;

Please refer to these knowledge base articles for STM32 CAN in normal mode (bxCAN):

Hope that helps you and others ..

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.