Skip to content

Add Peak CAN driver#14

Open
Notgnoshi wants to merge 7 commits intoag/tracingfrom
ag/pcan
Open

Add Peak CAN driver#14
Notgnoshi wants to merge 7 commits intoag/tracingfrom
ag/pcan

Conversation

@Notgnoshi
Copy link
Copy Markdown
Member

I don't have a way of testing this, so I have no idea how far off it is.

@Notgnoshi Notgnoshi self-assigned this Aug 8, 2023
@Notgnoshi Notgnoshi force-pushed the ag/tracing branch 2 times, most recently from a5c5e7d to cf7edb6 Compare August 16, 2023 16:27
@JannesBrands
Copy link
Copy Markdown
Member

I completed the implementation of PCAN that supports all interfaces. Anyway I dont have any PCAN to test it.
https://github.com/JannesBrands/AgIsoStack-rs/commit/273dfd6f51b87dbeb63aad20beb0ea5340a03e04

Comment thread src/driver/peak.rs Outdated
Comment thread examples/forward.rs
I suspect this lint was added to clippy since we last merged to main,
and that the CI/CD pipeline uses the latest clippy release.
@Notgnoshi Notgnoshi force-pushed the ag/pcan branch 2 times, most recently from a850b7c to eec1282 Compare November 7, 2023 02:45
@Notgnoshi
Copy link
Copy Markdown
Member Author

Fedora PCAN-Basic installation instructions

sudo dnf install kernel-devel popt-devel
tar -xzvf peak-linux-driver-8.16.0.tar.gz
cd peak-linux-driver-8.16.0/
make KERNEL_LOCATION=/usr/src/kernels/6.5.9-200.fc38.x86_64/ clean
EXTRA_CFLAGS=-Wno-error=incompatible-pointer-types make KERNEL_LOCATION=/usr/src/kernels/6.5.9-200.fc38.x86_64/ NET=NETDEV_SUPPORT all
sudo make KERNEL_LOCATION=/usr/src/kernels/6.5.9-200.fc38.x86_64/ install

Question: Should this be a netdev or chardev network device? The peak driver documentation says they now default to using chardev.

forward example application instructions

Build the forward example like so

cargo run --example forward --features tracing,socketcan,peak --input-driver socketcan --input-interface can0 --output-driver pcan --output-interface USB0

This will read from the can0 socketcan interface (which you can use cansend can0 123#44556677 to send fake data on) and write to the USB0 pcan interface. I think it's maybe possible to create a virtual pcan device?

I don't know enough about PCAN to know if that would be easy to read from to test, so I think I'd use forward to read from USB0 and forward to can1 and use candump can1 to read back to the console for verification.

Jannes Brands and others added 3 commits November 6, 2023 21:48
builds, driver works, no functional test (no pcan available)

---------

Co-authored-by: Jannes Brands <jannes@jannesbrands.de>
Co-authored-by: Austin Gill <notgnoshi@gmail.com>
Including pcan support in the tests requires the test environment have
libpcanbasic available, which has to be built from source.
@Notgnoshi Notgnoshi changed the title DRAFT: Add Peak CAN driver Add Peak CAN driver Nov 7, 2023
@codecov
Copy link
Copy Markdown

codecov Bot commented Nov 7, 2023

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 39.13%. Comparing base (44006ea) to head (623c3eb).
⚠️ Report is 3 commits behind head on ag/tracing.

Files with missing lines Patch % Lines
src/driver/socketcan.rs 0.00% 19 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           ag/tracing      #14      +/-   ##
==============================================
- Coverage       40.67%   39.13%   -1.55%     
==============================================
  Files               8        8              
  Lines             563      575      +12     
==============================================
- Hits              229      225       -4     
- Misses            334      350      +16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Notgnoshi Notgnoshi marked this pull request as ready for review November 7, 2023 03:52
@Notgnoshi Notgnoshi requested a review from ad3154 November 7, 2023 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants