2025-09-24 1:42 AM - last edited on 2025-09-24 3:41 AM by mƎALLEm
TL;DR:
Two-node bus: STM32 (FDCAN1) ↔ CANable (SocketCAN) at 500 kbit/s
candump can0 shows frames from STM32, but STM32 keeps flagging ACK error and increments TxErrorCnt.
Scope on CANH/CANL (diff trace CH1–CH2) shows a dominant ACK bit in the ACK slot (!)
External loopback works.
Looks like my MCU isn’t “seeing” the ACK at its RX input—looking for eyes on transceiver mode pins, RX pin mapping/AF, and timing.
MCU: STSpin32G4
Transceiver: SN65HVD230DR
Other node: CANable / candleLight on Linux as can0.
Wiring: STM32 TXD/RXD ↔ CAN transceiver ↔ twisted pair to CANable.
Termination: 120 Ω at each end (I can measure ~60 Ω between CANH–CANL with power off; will re-check if requested).
Ground: Common GND between boards.
If helpful, I have shared the schematic snippet for the transceiver pins .
What works vs. what fails
Works
External loopback mode: frames “succeed.”
candump sees frames from STM32 in normal mode.
Scope on CANH/CANL shows clean dominant bits. The CH1–CH2 differential (pink) clearly shows a dominant pulse in the ACK slot.
Fails
In normal mode, FDCAN reports ACK error on every frame; TxErrorCnt climbs (I previously hit Error Warning/Passive).
Any insights or “you missed this obvious thing” would be hugely appreciated. Thanks!
![]()
![]()
2025-09-24 2:11 AM
I don't see anything obvious.
I don't have much experience with the STM32 CAN interface, although my company uses all sorts of CAN devices.
Perhaps you can try a lower baudrate, and play with the bit timing parameters (what the CAN spec calls "quanta").
The latter e.g. define at what point during a signal the IP samples the ACK.