cancel
Showing results for 
Search instead for 
Did you mean: 

CAN interface between two STM32F373C8 microcontrollers

Hassanfraz
Associate

Hi, I want to use CAN interface to transfer integer data from one micro controller to another. I am using STM32F373C8 microcontrollers. Please brief me the hardware connection too, from google I understand following.

uC1-------------------uC2

CAN_H----------------CAN_H

CAN_L------------------CAN_L

GND----------------------GND

But in our case we have , CAN_Tx and CAN_Rx pins. I have also swapped the pins for transmission. The boards are placed quite close to each other. I have implemented the ChatGPT code, but it stucks some where in receiving. I am attaching my main file here. Please guide me as soon as possible

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @Hassanfraz and welcome to the ST Community 😊.

I suggest you to use this exemple as a start for your project. This Can guide you on the configurations of your project. 

PS: don't forget to take a look at the README file of the project.

Best Regards.

STTwo-32 

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

2 REPLIES 2
STTwo-32
ST Employee

Hello @Hassanfraz and welcome to the ST Community 😊.

I suggest you to use this exemple as a start for your project. This Can guide you on the configurations of your project. 

PS: don't forget to take a look at the README file of the project.

Best Regards.

STTwo-32 

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.

Hassanfraz
Associate

Please look at my question again, I think there is any hardware issue. I am not using any discovery board, I have two independent controllers and connections are as below. 

        uC1         ------------------       uC2

CAN_TX(A12)------------------CAN_RX(A11)

CAN_RX(A11)------------------CAN_TX(A12)

GND----------------------GND

Furthermore when i compile the software it struck in the transmit routine, on the following line.

if (HAL_CAN_AddTxMessage(&CanHandle, &TxHeader, TxData, &TxMailbox) != HAL_OK)

{

/* Transmission request Error */

Error_Handler();

}

 Please guide me about the hardware as well.