Skip to main content
MBoes.1
Associate
January 13, 2020
Solved

CAN-Bus Setup for NUCLEO-F042K6

  • January 13, 2020
  • 3 replies
  • 8281 views

Hi,

I try to get the CAN BUS communication working on my NUCLEO-F042K6 dev Board. I Used the instrucions attached in the PDF.

First I used the Loop-Back Mode to test CAN communication. I have my transmitting messages in the main loop they only execute once and not in a 500ms interval as I intend. The receiving messages are all the time 0.

I tried to use the normal mode and attached a CAN-Transceiver (TJA1050 NXP)

but I can not receive or send any messages. Maybe I configured the clock wrong?

I attached the main.c file and a picture of my clock and CAN configuration.

Many thanks

Moritz

This topic has been closed for replies.
Best answer by JoniS

Yes, it should. But the source code file from opening post contains no configuration for those pins. When you generate the code again, remenber to enable internal pull up resistors for the CAN pins.

3 replies

JoniS
Senior
January 13, 2020

Where do you configure the Can gpio pins? Also if you don't have canbus to tap into, you should enable internal pullups for the can GPIO's to make it reliable.​

MBoes.1
MBoes.1Author
Associate
January 14, 2020

Hi thanks for the fast answer. I configured the pins in CubeMX (see image attached).

JoniS
Senior
January 14, 2020

Main.c file from opening post does not contain any configuration for pa11/pa12 pins or do I miss it?​

MBoes.1
MBoes.1Author
Associate
January 14, 2020

I thought this is done automatically by CubeMX when I enable CAN communication?

MBoes.1
MBoes.1Author
Associate
January 14, 2020

Hi thanks for your help mate ;)