cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with CAN TX on Nucleo F767ZI

luisegzb
Associate

Greetings,

I have a project on the Nucleo F767ZI board where I try to send a CAN message to another device (in particular, an Maxon EPOS4 Compact 50/5 drive). I can receive messages from this device with no problem, however, as soon as I press the button to start sending messages from the Nucleo board to that device, the drive enters into fault state, allegedly because of a 'CAN passive mode error', which arises because of a bad network configuration or baud rate setting. The Nucleo can still receive messages with no problem after this happens.I have checked the H/L connections with a scope, and can see that there is data coming from both devices.

 

My setup is as follows:

Hardware Setup:

Nucleo board connected to CAN_H/_L through a TJA1050 transceiver board (schematic attached)
120 Ohm termination resistor in both the TJA board as well in the other device (resistor in the EPOS drive). I get a 60 Ohm reading between H and L when using a multimeter, as expected.
Connected device powered by an external supply, however both GNDs are connected (continuity test + correct voltage readings).


Board configuration:

- CAN: 125kbps baud rate, 13 bit quanta for seg. 1 and 2 for seg. 2 (calculated to get a 87.5% sample, following CANOpen specification)

- Clock: 200MHz

To configure the bit rate, I used the following sources:
https://www.port.de/en/bit-timing.html
https://www.nxp.com/docs/en/application-note/AN1798.pdf?origin_team=T2VVBR6FR

 

The project and the schematic of the transceiver board are attached. I am glad to provide any additional information, if necessary. I also appreciate any tips on working with similar CAN devices.

Many thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

Hello,

You are using HSI as clock source for CAN. This is not recommended. Need to use an external crystal. As you are using Nucleo-F767ZI board, you can use STLINK-MCO output as clock source for the system clock. It's based on the 8MHz crystal of STLINK module.

So use RCC in Bypass mode. I've updated your ioc file and attached it.

PS: I kudoed your post because you provided a complete information of the HW and software of your setup which is not the case for many posts in the community especially for CAN subjects.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
SofLit
ST Employee

Hello,

You are using HSI as clock source for CAN. This is not recommended. Need to use an external crystal. As you are using Nucleo-F767ZI board, you can use STLINK-MCO output as clock source for the system clock. It's based on the 8MHz crystal of STLINK module.

So use RCC in Bypass mode. I've updated your ioc file and attached it.

PS: I kudoed your post because you provided a complete information of the HW and software of your setup which is not the case for many posts in the community especially for CAN subjects.

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.