cancel
Showing results for 
Search instead for 
Did you mean: 

fdcan communication between nucleo and discovery kit

revvathi
Associate III

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

28 REPLIES 28

500000 nominal bitrate 


@revvathi wrote:

500000 nominal bitrate 


Ok, then you need to set your Nominal bitrate to that value ..

If you are not familiar with CAN/CANFD please study it before going ahead with tests.

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.

i have matched it to 500000  baudrate at both the ends how do i proceed further like my hardware setup is ready data is ready to be transmited at h7 live expressions and data types have been intialised too on the other end but it still aint getting trasmitted i have gone through entire process of fdcan could u pls help me out 

 

revvathi
Associate III

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
ST Employee

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.

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
ST Employee

Hello,

Please read this article: https://community.st.com/t5/stm32-mcus/faq-can-i-use-a-can2-0a-can2-0b-transceiver-to-transmit-canfd/ta-p/689733

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.

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

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.