Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CANManager: support CAN frame logging #28779

Merged
merged 5 commits into from
Dec 10, 2024

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Nov 30, 2024

This adds support for logging all incoming CAN frames in a form that can be played back by a python script. It is enabled using a CAN_Pn_OPTIONS bit.
I have been doing this for quite some time with a lua script in examples/CAN_logger.lua, but that only works for can interfaces set to scripting, and it also can miss frames, plus does not support CANFD.
The utility of this functionality is:

  • writing drivers for new CAN devices. We can ask a user to capture all CAN frames then playback in SITL to develop the driver
  • debug hard to reproduce CAN issues on busy CAN buses

The overhead of the logging approach is quite low, as is flash cost.

I've marked this for 4.6 as it will be so useful for supporting users, but it may be more suitable for a bit later 4.6.x release

@tridge tridge added the CAN label Nov 30, 2024
@tridge tridge force-pushed the pr-can-frame-logging branch 3 times, most recently from 33f4e3b to 9d4032b Compare November 30, 2024 23:27
this supports logging of all bxCAN and CANFD frames, which helps with
debugging tricky CAN support issues and for the development of new CAN
driver lua scripts
@tridge tridge force-pushed the pr-can-frame-logging branch from 9d4032b to 94e0e24 Compare December 9, 2024 22:39
Copy link
Member

@bugobliterator bugobliterator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@tridge tridge merged commit 4f7a1fc into ArduPilot:master Dec 10, 2024
99 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 4.6.0-beta2
Development

Successfully merging this pull request may close these issues.

2 participants