Skip to main content
Bence Stocker
Associate II
Apr 16, 2020 2:14 PM UTC
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 ?

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
Apr 16, 2020 2:34 PM UTC

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
Apr 16, 2020 2:36 PM UTC

Thanks :)

Khouloud OTHMAN
Associate
Apr 16, 2020 2:38 PM UTC

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
Apr 16, 2020 2:45 PM UTC

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