2025-01-10 09:20 PM
Hi all,
I am trying to establish a CAN communication between stm32f469i and PC. I have used Cube MX to generate CAN driver. I am not getting any data from the stm32f469i. I have also attached code for the reference.
Solved! Go to Solution.
2025-01-11 06:42 AM
This is not a setting that is recommended. The sample point is between Seg1 and Seg2, and should be at about 75% to 90% (CanOpen has normaly 87.5%). Please us a Can Bus timing calculator (for example http://www.bittiming.can-wiki.info/ ) to get better timing parameters.
Did you check with a oscilloscope if the STM32 is transmitting anything?
Wenn debugging your code, did it enter the error handler? if yes were?
2025-01-11 06:03 AM
Did You set the apropriet bitrate in CubeMX?
in MX_CAN2_Init() the settings are strange:
hcan2.Instance = CAN2;
hcan2.Init.Prescaler = 120;
hcan2.Init.Mode = CAN_MODE_NORMAL;
hcan2.Init.SyncJumpWidth = CAN_SJW_1TQ;
hcan2.Init.TimeSeg1 = CAN_BS1_1TQ;
hcan2.Init.TimeSeg2 = CAN_BS2_1TQ;
2025-01-11 06:10 AM
Hello,
Thanks for your response. Yes the bit rate was configured as 125000 bps.
2025-01-11 06:42 AM
This is not a setting that is recommended. The sample point is between Seg1 and Seg2, and should be at about 75% to 90% (CanOpen has normaly 87.5%). Please us a Can Bus timing calculator (for example http://www.bittiming.can-wiki.info/ ) to get better timing parameters.
Did you check with a oscilloscope if the STM32 is transmitting anything?
Wenn debugging your code, did it enter the error handler? if yes were?
2025-01-11 07:40 AM
Hi,
Thanks for your valuable support. As you have suggested configured Seg1 and Seg2 from http://www.bittiming.can-wiki.info/
Now it is working Perfectly :
Also attached the updated code. Thank you once again .