Skip to content

Implement CAN logging with SavvyCAN's protocol #10

Open
3 of 7 issues completed
Open

Description

@Tichael

We need a way to make it easy to reverse engineer CAN buses from the firmware itself. The idea is to implement SavvyCAN's network protocol and send CAN frames using Wifi. We may need to disable the normal vehicle tasks when using this.

There was already a CAN debug tool that was started to be implemented in the firmware, but it will be easier to just use SavvyCAN instead.

Notes from the audit (old BLE CAN debug, still in main)

  • Remove the old BLE CAN-debug path as part of this (or before):
    core-interface/src/can_debug.rs, CAN_DEBUG_RX_CHANNEL, the board taps,
    MCP2515 debug mask switching, and publish_can_debug_task. In contracts,
    mark SetCanDebugEnabled / UpdateCanDebugFilters / CanDebugUpdate
    [deprecated = true] (append-only rule).
    Until then it's reachable by any bonded phone: SetCanDebugEnabled with
    bus_id >= 8 panics with a shift overflow in debug builds
    (can_debug.rs:73, also :46). Release builds silently wrap.
  • Lessons for the new version:
    • Validate bus_id against MAX_CAN_BUSES / the configured bus count.
    • Turn logging off when the client disconnects (the old one stays on).
    • With "disable normal vehicle tasks", also force read-only on.
    • Keep logging traffic off the shared command/state queues.

Sub-issues

Sub-issues

3 of 7 Issues completed
Loading 7 sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions