Repository navigation
examples: add CAN FD support to ServoNode and fix Linux drivers for CAN FD - #95
Open
rishabsingh3003 wants to merge 3 commits into
Open
rishabsingh3003 wants to merge 3 commits into
rishabsingh3003 wants to merge 3 commits into
Conversation
LinuxCANInit passed can_fd to the mcast and socketcan init functions, but the parameter is named canfd, so the driver failed to compile with CANARD_ENABLE_CANFD=1
The canfd flag of a received frame was never set, so FD transfers were decoded using the classic CAN tail array optimisation rules. A CAN FD socket also delivers classic frames, which are shorter than struct canfd_frame. These were rejected with -EIO, which stopped a node from receiving classic frames from other nodes on the bus.
Adding canfd as a second argument sends all transfers as CAN FD frames. Without it the behaviour is unchanged. When sending CAN FD the messages are encoded without tail array optimisation. A CAN FD frame is padded to the next valid length, so the receiver cannot work out the length of a trailing array from the transfer length, and DroneCAN GUI Tool fails to decode the transfer with "Not enough bits". Node ID allocation requests are still sent as classic CAN, as the request is hand-encoded for 8 byte frames. The memory pool is larger as the block size goes from 32 to 128 bytes when CAN FD is enabled. With the old 1024 byte pool a GetNodeInfo response no longer fits in the transmit queue when sending classic CAN.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.