cancel
Showing results for 
Search instead for 
Did you mean: 

CAN-Bus Setup for NUCLEO-F042K6

MBoes.1
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

6 REPLIES 6
JoniS
Senior

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
Associate II

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

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

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

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.

MBoes.1
Associate II

Hi thanks for your help mate ;)