Skip to main content
Bence Stocker
Associate II
April 16, 2020
Question

I would like to use an STM32F042F4 MCU with CAN communication. I saw the CAN bus in STM32CubeMx by Connectivty, but i can't select it ?

  • April 16, 2020
  • 4 replies
  • 1306 views

Dear ST,

I would like to use an STM32F042F4 MCU with CAN communication. I saw the CAN bus in STM32CubeMx by Connectivty, but i can't select it (it is grey)? I read in the datasheet of the MCU that i have to remap CAN bus pin to PA10 and PA9.

Can you help me, how can select CAN bus in STM32CubeMx?

Thanks

This topic has been closed for replies.

4 replies

berendi
Principal
April 16, 2020

Let the mouse pointer rest a bit over the grayed-out CAN peripheral.

0693W000000Vx1ZQAS.png

Now go to SYS as advised to swap the pins

0693W000000Vx36QAC.png

and CAN is no longer grayed out.

Bence Stocker
Associate II
April 16, 2020

Thanks :)

Khouloud OTHMAN
Associate
April 16, 2020

Hello Bence Stocker,

In order to activate CAN bus in STM32CubeMx when working with STM32F042F4 MCU, select SYS from the the component list and then check "Pins PA11/12 instead of pins PA9/10" in "SYS Mode and Configuration" panel, CAN bus will be automatically available and you can select it.

0693W000000Vx3uQAC.png

Best Regards,

Khouloud.

Nesrine.JLASSI
Visitor II
April 16, 2020

Hi @Bence Stocker​ 

You need PA12 (to swap pins go in sys): go to sys then select Pin PA11/PA12 instead of pins PA9/10

0693W000000Vx4tQAC.png

0693W000000Vx78QAC.png

Best regards,

Nesrine