cancel
Showing results for 
Search instead for 
Did you mean: 

CAN BUS TX & RX example (stm32f042g6u8) , How to create project using CUBEMX?

Ss.61
Associate III

I try to create a project based on CAN bus but the CAN option is disable in CUBEMX ide.

*Controller - stm32f042g6u8 

*Cube mx ide version - V 4.24

  • i want to know how to create a CAN BUS project using cubemx & without it,
  • Examples are suggested for better understanding
1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Here is one example for STM32F0 with CAN:

https://github.com/STMicroelectronics/STM32CubeF0/blob/4390ff6bfb693104cf97192f98c3dc9e3a7c296a/Projects/STM32072B_EVAL/Examples/CAN/CAN_Networking/Src/main.c

I don't see any for the STM32F042, but the code should be very similar.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Guru

You can hover over something that is grayed out to find out why. In this case:

0693W00000ANLqJQAX.png 

So go into SYS to swap pins, then you can enable CAN.

If you feel a post has answered your question, please click "Accept as Solution".
TDK
Guru

Here is one example for STM32F0 with CAN:

https://github.com/STMicroelectronics/STM32CubeF0/blob/4390ff6bfb693104cf97192f98c3dc9e3a7c296a/Projects/STM32072B_EVAL/Examples/CAN/CAN_Networking/Src/main.c

I don't see any for the STM32F042, but the code should be very similar.

If you feel a post has answered your question, please click "Accept as Solution".
Ss.61
Associate III

Thank you very much for your input i will try as per your input.