2024-08-22 03:50 AM - last edited on 2024-08-22 04:22 AM by SofLit
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
Solved! Go to Solution.
2024-08-26 01:11 AM
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.
If still having issues you need to share your schematics especially the CAN part including the transceiver and the terminating resistors.
2024-08-22 04:28 AM - edited 2024-08-22 04:35 AM
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.
2024-08-25 03:08 AM
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,
2024-08-26 01:11 AM
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.
If still having issues you need to share your schematics especially the CAN part including the transceiver and the terminating resistors.
2024-08-28 07:14 AM
Hello @ssalvi ,
Could you please tell if you solved the issue?
Thank you.
2024-08-29 06:51 PM