2026-02-13 1:31 AM
Hi,
I am working with STM8AF5268 and implementing CAN communication using the STM8S/A Standard Peripheral Library.
MCU: STM8AF5268
CAN Transceiver: SN65HVD1050
CAN Analyzer: Waveshare USB-CAN-FD
Baud rate: 100 kbps
120Ω across CANH and CANL at STM8 side
USB-CAN-FD termination enabled
Measured ≈ 60Ω across CANH–CANL
SN65HVD1050 VCC = 5V (verified).
Common ground connected between STM8 board and analyzer.
When attempting transmission, the CAN controller enters Bus Error / Bus-Off state.
No frame appears on the USB-CAN-FD
When sending frames from the USB-CAN-FD tool at 100 kbps, the STM8 does not receive any frames.
RX interrupt is not triggered.
I am using STM8S/A Standard Peripheral Library for CAN and interrupt handling (stm8s_it.c with proper vector configuration).
What are the common reasons for Bus-Off during transmission on STM8AF52xx?
Is there anything specific required in STM8AF52xx CAN initialization before transmitting?
Could incorrect bit timing configuration cause immediate bus errors?
Are there any specific hardware-level checks for STM8AF52xx CAN (TX/RX pin configuration, alternate function setup, transceiver standby pin handling, etc.)?
If anyone has experience with STM8AF52xx CAN, please guide me
thank you (i attach the file for reference)
Solved! Go to Solution.
2026-02-13 1:47 AM - edited 2026-02-13 1:51 AM
Hello @Naresh1 and welcome to the ST community,
First I'm not STM8 product expert but I can help with CAN communication subject.
Second, Bus-off state mainly occurs with a hardware issue: wiring issues or an issue with your transceiver.
Or bitrate issue config i.e. bitrate mismatch.
- Check is the S pin of your transceiver: is it connected to the GND?
- Check also the power supply of your transceiver on its pins directly.
- Check all your wiring with a continuity test with your device powered off.
- Check your bitrate it should be exactly the same for all the nodes (no approximative bitrate values).
- Try the Loopback mode to confirm whether it is a hardware issue. If Loopback mode works it's a hardware issue or a bitrate mismatch issue.
2026-02-13 1:47 AM - edited 2026-02-13 1:51 AM
Hello @Naresh1 and welcome to the ST community,
First I'm not STM8 product expert but I can help with CAN communication subject.
Second, Bus-off state mainly occurs with a hardware issue: wiring issues or an issue with your transceiver.
Or bitrate issue config i.e. bitrate mismatch.
- Check is the S pin of your transceiver: is it connected to the GND?
- Check also the power supply of your transceiver on its pins directly.
- Check all your wiring with a continuity test with your device powered off.
- Check your bitrate it should be exactly the same for all the nodes (no approximative bitrate values).
- Try the Loopback mode to confirm whether it is a hardware issue. If Loopback mode works it's a hardware issue or a bitrate mismatch issue.
2026-02-18 5:53 PM
I have successfully received the CAN messages. The issue was identified as a hardware-related problem rather than a software fault.
Additionally, I would like to share an observation for future STM8S projects. The interrupt vector table for STM8S is located within the project directory under:
stm8s_stdperiph_template → STVD
This structure can make it difficult to locate, especially for developers who are new to STM8. It may be beneficial to document this more clearly or reorganize the project layout to improve accessibility.