Skip to main content
Associate II
February 11, 2025
Solved

fdcan communication between nucleo and discovery kit

  • February 11, 2025
  • 6 replies
  • 3477 views

the objective of this particular project was to transmit data frames from stm32h750dbk(discovery kit) to stm32g491re(nucleo)
it is debugging and creating live expression for both of the data types in receiving and transmit end of board i have not connected any transceiver between them because it has inbuilt fdcan ports 
i am attaching both the codes for g4 and h7 
the picture of hardware and the live expression result when debugged separately 

temp1.pngtemp2.pngWhatsApp Image 2025-02-11 at 7.56.11 PM.jpeg

Best answer by mƎALLEm

Hello,

1- You have two issues in the RCC config with H750 Disco board:

 mALLEm_0-1741266772356.png

1-1. You need to use HSE with the external crystal oscilator (25MHz) instead of HSI for CAN communication.

1-2. With a crystal oscillator you need to set Bypass configuration in the RCC.

In final you need this config:

mALLEm_1-1741266772359.png

2- Another issue in the GPIO config on H7:

You set PB9 as CAN_Tx:

mALLEm_2-1741266772362.png

 

while in the schematics, FDCAN1_Tx should be PH13:

mALLEm_3-1741266772366.png

 

That's why every time I ask to check the hardware.

I've modified some parameters in your ioc files and in your projects. I've attached a zip file containing both projects.

As you can see G4 is receiving the CAN messages in live:

mALLEm_4-1741267393148.png

Migrate to CubeIDE V1.18.0/CubeMx 6.14.0.

If you didn't succeed with the modified projects, I'm pretty sure it's an issue in your HW. Therefore I will close the thread after a period of time.

Hope that helps.

 

6 replies

mƎALLEm
Technical Moderator
February 11, 2025

Hello,

Thank your for sharing the image because it raises a big issue.

You are using CAN in a bad hardware configuration.

From the disco board there is a CAN-FD transceiver (CAN_H/CAN_L) that you connected directly to FDCAN_Tx and FDCAN_Rx in the NUCLEO board!

You need to add a transceiver to the NUCLEO board to establish a CAN bus between two CAN nodes like the following:

SofLit_0-1729078448084.png

You can also refer to this article and the related Github hotspot.

"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."
revvathiAuthor
Associate II
February 11, 2025

WhatsApp Image 2025-02-11 at 8.27.43 PM.jpeg

IS the connection right now 

mƎALLEm
Technical Moderator
February 11, 2025

Sorry I didn't notice this issue:


@revvathi wrote:

WhatsApp Image 2025-02-11 at 8.27.43 PM.jpeg

IS the connection right now 


You don't need a transceiver for the DISCO board side. It has already a transceiver on board:

SofLit_0-1739287732812.png

Also, refer to the figure I previously shared.

If you are not familiar with CAN bus need to have more information about it.

"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."
mƎALLEm
Technical Moderator
February 11, 2025

1- What is the issue?

2- Could you please share the schematics of the transceiver's shield?

"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."
revvathiAuthor
Associate II
February 11, 2025

1)transmit data gets initialised to send but at the receiving  side no data is envoked 
2)i didnt get u what do u mean by shield :(

mƎALLEm
Technical Moderator
February 11, 2025

1- Do you mean the data are transmitted were not received? By whom? which is transmitting and which is receiving?

2- The CAN module:

SofLit_0-1739286591863.png

 

"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."
revvathiAuthor
Associate II
February 11, 2025

1)H7 is transmitting and G4 is receiving 
2)can transciever module used is NXP TJA1050 WhatsApp Image 2025-02-11 at 8.43.01 PM.jpegWhatsApp Image 2025-02-11 at 8.42.58 PM.jpeg

revvathiAuthor
Associate II
February 24, 2025

Merging the same question into the same thread. Please don't duplicate the same question. Thanks.

I am implementing FDCAN communication between an STM32H750DBK (transmitting) and an STM32G491RE (receiving) with a CAN transceiver connected on the G4 side. I am using STM32CubeIDE for development.

On the H7 side, when I load data into the FDCAN transmit buffer, I can see the correct values in the live expressions window. However, when I start execution, the data does not clear from the buffer as expected.

On the G4 side, the live expressions window shows that the receive buffer is ready and initialized with a 7-byte array, but no actual data is being received. Additionally, I am unable to run both boards simultaneously in CubeIDE due to multiple ST-LINK interfaces being detected.
also the transceiver  doesn't need a 120 ohm terminating resistor read tht it has an inbuilt resistor already

WhatsApp Image 2025-02-24 at 7.43.59 PM.jpeg

mƎALLEm
mƎALLEmBest answer
Technical Moderator
March 6, 2025

Hello,

1- You have two issues in the RCC config with H750 Disco board:

 mALLEm_0-1741266772356.png

1-1. You need to use HSE with the external crystal oscilator (25MHz) instead of HSI for CAN communication.

1-2. With a crystal oscillator you need to set Bypass configuration in the RCC.

In final you need this config:

mALLEm_1-1741266772359.png

2- Another issue in the GPIO config on H7:

You set PB9 as CAN_Tx:

mALLEm_2-1741266772362.png

 

while in the schematics, FDCAN1_Tx should be PH13:

mALLEm_3-1741266772366.png

 

That's why every time I ask to check the hardware.

I've modified some parameters in your ioc files and in your projects. I've attached a zip file containing both projects.

As you can see G4 is receiving the CAN messages in live:

mALLEm_4-1741267393148.png

Migrate to CubeIDE V1.18.0/CubeMx 6.14.0.

If you didn't succeed with the modified projects, I'm pretty sure it's an issue in your HW. Therefore I will close the thread after a period of time.

Hope that helps.

 

"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."
revvathiAuthor
Associate II
March 7, 2025

I'll check this out if it works 
also should the type of transceiver being connected be of any worries like example the one i'm using supports  classic can and not fdcan according to data sheet but is there a chance to use this transceiver by shrinking the baud rate 

mƎALLEm
Technical Moderator
March 8, 2025
"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."
revvathiAuthor
Associate II
March 11, 2025

Which transceiver is suggest-able to be used for the following case I could decrease the bitrate to lesser than 1Mb/s

mƎALLEm
Technical Moderator
March 11, 2025

Any CAN transceiver that can reach 1Mb/s with 3.3V power supply or 5V with VIO pin.

Example of transceiver used on ST eval boards: SN65HVD230

Hope that helps.

"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."