CAN Bus Error – Transmit and Reception Not Working – STM8AF5268
- February 13, 2026
- 1 reply
- 182 views
CAN Bus Error and Reception Not Working – STM8AF5268
Hi,
I am working with STM8AF5268 and implementing CAN communication using the STM8S/A Standard Peripheral Library.
Hardware Setup
MCU: STM8AF5268
CAN Transceiver: SN65HVD1050
CAN Analyzer: Waveshare USB-CAN-FD
Baud rate: 100 kbps
Termination
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.
Clock Configuration
CAN Initialization
CAN Transmit Code
Problems
:keycap_1: Transmission Issue
When attempting transmission, the CAN controller enters Bus Error / Bus-Off state.
No frame appears on the USB-CAN-FD
:keycap_2: Reception Issue
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).
Questions
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.)?
- please share there is any sample code /example code and suggestions
If anyone has experience with STM8AF52xx CAN, please guide me
thank you (i attach the file for reference)

