Skip to content

Report MCP2515 CAN bus health #116

Backlog
Backlog

Description

@Tichael

Part of #12. Follow-up to #115, which added CAN bus health for ESP TWAI and PC (SocketCAN) buses only.

MCP2515 buses don't count what they receive. As a result they have no 5 s RX log on the serial console, and they don't appear in SystemState.can_bus_health, so the app shows nothing for them. They were left out because there was no MCP2515 hardware to test with.

To do

  • In the MCP2515 RX loop (boards/esp/src/can.rs), count received frames and how many matched the vehicle filters in a core_interface::CanRxCounts.
  • Read the EFLG register:
    • RX0OVR/RX1OVR count as overruns; clear them afterwards.
    • TXBO counts as a bus-off.
    • The RX warning and error-passive flags, or the REC counter, count as RX errors.
  • Every 5 s (and right after a bus-off), log the same info line as TWAI. Then call report_can_bus_window(bus_id, &counts, Some(listen_only)), the same way TWAI's end_rx_window does.
  • Keep the counting in plain helpers that host tests can cover.
  • Update docs/can.md: remove the "MCP2515 buses don't have this log or the bus health yet" notes.
  • Test on real MCP2515 hardware before merging.

Activity

  1. added theissue type on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions