cancel
Showing results for 
Search instead for 
Did you mean: 

CAN TX Error

ssalvi
Associate II

Hi,

I am new to ST, trying CAN TX RX Code.

Every time I Transmit Error frame is getting generated instead of Data .

Please  suggest what i am doing wrong in the below code. 

I am sharing my main file

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

These are bad configurations and not recommended values as they are too low.

Need to increase BS1 and BS2 as match as possible where sample point is around 75% to 85%.

I'm proposing these values: Prescaler=4, BS1=14, BS2=3.

SofLit_0-1724659666203.png

If still having issues you need to share your schematics especially the CAN part including the transceiver and the terminating resistors.

 

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

5 REPLIES 5
SofLit
ST Employee

Hello @ssalvi and welcome to the community.

As you are using Normal mode, you didn't tell if you already established a CAN bus where at least two nodes (your L4 MCU is among them + a CAN transceiver) are connected to it. Did you do that? if not, you cannot use CAN as UART or SPI to use it in standalone as it is or connect externally CAN_Tx to CAN_Rx. You need to use one of the test modes example the LoopBack mode in that case.

 

 

 

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.

Hi @SofLit ,

This time I have connected my node(Nucleo+MC2551 Transceiver) to another external CAN Bus where i want to receive and send data. I am still sending Error frame.

I am also not able to put recive in interrupt. I want to read data from 0x100 and 0x200 Msg ID on my bus.

Also tried by pulling Up RX pin internally, but didnt work.

PS:- This time i am using NUCLEO-F103RB insted of L476, i guess CAN Configuration on both are same.

 

regards,

Hello,

These are bad configurations and not recommended values as they are too low.

Need to increase BS1 and BS2 as match as possible where sample point is around 75% to 85%.

I'm proposing these values: Prescaler=4, BS1=14, BS2=3.

SofLit_0-1724659666203.png

If still having issues you need to share your schematics especially the CAN part including the transceiver and the terminating resistors.

 

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.

Hello @ssalvi ,

Could you please tell if you solved the issue?

Thank you.

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

Hi @SofLit ,

Issue resolved thanks .

 

regards