RPi 4 + VenusOS 3.73 + Waveshare CAN HAT mcp251xfd not working

Hi Community,

I’m trying to use a Raspberry Pi 4 running Venus OS v3.73 with a Waveshare RS232/RS485/CAN HAT. The board has two CAN channels:

  • can0 → MCP2515, SPI0.0, 16 MHz oscillator, GPIO23 interrupt
  • can1 → MCP2518FD / MCP2562FD, SPI0.1, 40 MHz oscillator, GPIO24 interrupt

Current overlays:

dtparam=spi=on
dtoverlay=mcp2515-can0,spi0-0,oscillator=16000000,interrupt=23
dtoverlay=mcp251xfd,spi0-1,oscillator=40000000,speed=10000000,interrupt=24

I renamed the interfaces with udev to avoid can0/can1 race issues:

  • vecan0 = spi0.0 = mcp2515 = 8 MHz
  • vecan1 = spi0.1 = mcp251xfd = 40 MHz

Venus OS seems to accept the new names and creates:

  • /service/vecan-dbus.vecan0
  • /service/vecan-dbus.vecan1

The problem:

  • vecan0 / MCP2515 works perfectly with a Victron VE.Can device.
  • vecan1 / MCP2518FD shows identical problems with both a Multi RS Solar and a Cerbo GX.
  • vecan1 receives no valid frames from Victron and tends to go ERROR-PASSIVE / bus-off when trying to transmit.
  • Same cable, same pinout, same Victron device works on vecan0.

Tests already done:

  • Confirmed vecan1 loads correctly as mcp251xfd.
  • Confirmed 40 MHz clock is applied.
  • Confirmed GPIO24 interrupt is active.
  • Confirmed CAN-FD is not enabled; interface MTU is 16, classic CAN.
  • Confirmed vecan1 can transmit and receive when directly connected to vecan0.
  • Confirmed vecan1 TX → vecan0 RX works.
  • Confirmed vecan0 TX → vecan1 RX works.
  • Tested with clean Cat5 cable:
  • VE.Can RJ45 pin 3 → GND
  • pin 7 → CAN-H
  • pin 8 → CAN-L
  • Tested H/L swapped: worse, no useful RX/TX.
  • Checked termination: expected 120 Ω / 60 Ω depending on one or two terminators.
  • Stopped Venus CAN services and tested manually with candump / cansend.
  • With nothing connected and services stopped, both interfaces stay ERROR-ACTIVE.
  • Tried restart-ms 0 to avoid auto-restart behaviour.
  • Previously tried matching bit timing/sample point around 250 kbit/s / 0.875.

Typical result:

  • vecan0 + VE.Can device → works
  • vecan1 + VE.Can device → no valid frames, ERROR-PASSIVE / bus-off
  • vecan0 ↔ vecan1 direct → works

So the MCP2518FD channel is not dead, but it does not seem to interoperate electrically with Victron VE.Can ports, while the MCP2515 on the same HAT does.

Has anyone seen MCP2518FD / MCP2562FD behave like this with VE.Can? Is there any known issue with the mcp251xfd driver, MCP2562FD transceiver, bit timing, SPI speed, termination/common-mode, or Venus OS service handling that could explain this?

Any specific test I should run next?

Any feedback/ideas on how to proceed next will be appreciated,

My package

GitHub - kwindrem/VeCanSetup: Manages Victrion VenusOs VeCan (aka CANbus) ports · GitHub

helps with setup for some of the available interfaces.

I needed to add dtoverlay=spi1-3cs for any 2-channel hats. (I actually provide a spi1-1cs overlay to minimize GPIO conflicts with digital inputs and relay outputs, etc. but if that’s not an issue for you the stock spi1-3cs should be fine.

I do not know this will help but it’s all I can think of.