-
Notifications
You must be signed in to change notification settings - Fork 2k
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
native/periph_can: usability improvements and documentation updates #17949
native/periph_can: usability improvements and documentation updates #17949
Conversation
c91d499
to
91e4c34
Compare
Maybe @benpicco or @DanielLockau-MLPA might be interested as well since they seem to use CAN through Dose. |
DOSE doesn't use CAN, but @firas-hamdi has been working with CAN lately |
boards/native/Makefile.include
Outdated
PERIPH_CAN_FLAGS = --can $(VCAN_IFACE) | ||
TERMFLAGS += $(PERIPH_CAN_FLAGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not:
PERIPH_CAN_FLAGS = --can $(VCAN_IFACE) | |
TERMFLAGS += $(PERIPH_CAN_FLAGS) | |
TERMFLAGS += --can $(VCAN_IFACE) |
?
@@ -30,8 +30,12 @@ extern "C" { | |||
* @brief Default parameters (device names) | |||
*/ | |||
static const candev_params_t candev_params[] = { | |||
#if CAN_DLL_NUMOF >= 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand how the CAN_DLL_NUMOF is supposed to be set and how it integrate with the native can flags (is it possible to have multiple calls to --can ?).
Where is it documented btw ? Maybe we should make it more explicit that it's limited to 2 (and why 2 btw) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some archeology search and found:
Where @vincent-d mentions wanting multiple CAN devices for testing. This still allows but sets by default only one can
device, AFAIK from the original PR #5793 there is no mention of a testing procedure for this. your testing was on the same interface #5793 (comment). I did add some more documentation on this though.
(is it possible to have multiple calls to --can ?)
Yes, I added more documentation on this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some archeology search and found:
Where @vincent-d mentions wanting multiple CAN devices for testing. This still allows but sets by default only one can
device, AFAIK from the original PR #5793 there is no mention of a testing procedure for this. your testing was on the same interface #5793 (comment). I did add some more documentation on this though.
(is it possible to have multiple calls to --can ?)
Yes, I added more documentation on this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, things are clearer now. Just found a typo in the native related README. Please squash!
tests/candev/README.native.can.md
Outdated
interfaces will not be connected by default but look like if they where on | ||
different Buses. | ||
|
||
Too configure which `vcan` interface each native CAN device should use then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too configure which `vcan` interface each native CAN device should use then | |
To configure which `vcan` interface each native CAN device should use then |
86e4931
to
667454b
Compare
squashed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
Thanks @aabadie! |
Contribution description
This PR wants to make the
vcan
setup usage for native easier. It does so by:README
for virtual can interfaces while adding details on how to connect two can interface instead of relying oncandump
/cansend
and others.PERIPH_CAN_FLAGS
to specify the can interface to be used, similar to howPORT
is used withtap*
, but using an explicitly distinct variable for this.I've also removed the
apt-get
instructions for installing the32bit
libsocketcan instructions since it's not packages in recent distro versions and with #17533 its used through a pkg by default.Testing procedure
Follow the
README.native.can.md
instructions to se tup two native can interfaces, and send messages between them as well as from the Linux host.Issues/PRs references
It depends on #17533 to not have to re-adapt the README.