-
Notifications
You must be signed in to change notification settings - Fork 290
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
Document CAN-FD support #79
Document CAN-FD support #79
Conversation
The bits in GS_CAN_MODE_ correspond to the bits in GS_CAN_FEATURE_*. This means the bits 5 and 6 of GS_CAN_MODE_ are not "free", document this by adding a comment to the corresponding GS_CAN_FEATURE_*.
19e6ff9
to
e4bc5d0
Compare
Cool ! A few questions / points :
I'm totally in favour of doing our best to keep candlelight and other firmwares "compatible", as much as possible. TBH I'm really not up to date on what cantact is doing though. |
ACK - The company ("Geschwister Schneider") who brought the driver mainline and sold the HW is gone now.
As the GS company is gone now, I consider the candlelight firmware and the Linux kernel driver as the reference implementation.
I'll add some documentation to the code.
@ericevenchick designed a dual CAN-FD capable board, firmware and Linux driver. Several people are now involved to bring this Linux driver mainline. He has extended the USB protocol and there are I think 2..3 other projects implementing it. |
The CANtact FD and other devices implement a gs-usb compatible USB protocol. The protocol has been extended to support CAN-FD and the changes on the Linux gs_usb driver will be mainlined soon. This patch adds the new GS_CAN_MODE_*, GS_CAN_FEATURE_*, GS_USB_BREQ_DATA_BITTIMING, and GS_CAN_FLAG_* bits as well as struct gs_host_frame_canfd to the candlelight driver. This is mainly for documentation purpose, as the STM32F042 and STM32F072 don't support CAN-FD. But there are some ports to CAN-FD capable STM32 µC that can make use of these definitions. [1] linklayer/gs_usb_fd#2
The documents a workaround for a NXP chip errata on LPC546xx controllers (Errata sheet LPC546xx / USB.15). According to the document corruption can occur when the following conditions are met: * A TX (IN) transfer happens after a RX (OUT) transfer. * The RX (OUT) transfer length is 4 + N * 16 (N >= 0) bytes. Even though the struct gs_host_frame has a size of 76 bytes for a FD frame, which does not apply to the above rule, corruption could be seen. Adding a dummy byte to break the second condition also on transfer lengths with 4 + N * 8 bytes reliably circumvents USB transfer data corruption. The firmware can now request this quirk by setting GS_CAN_FEATURE_REQ_USB_QUIRK_LPC546XX.
…ST_EXT Some CAN-FD capable controllers have different bittiming constants for arbitration phase and data phase to reach maximum performance at higher speeds.
e4bc5d0
to
592659a
Compare
Good that I did the documentation bits, I found an overlap in the new |
Ok. As far as this PR is concerned, ready to merge or should I wait a few days to be sure ? |
Due to the discovered overlap, let's wait until @pfink-christ in the linklayer/gs_usb_fd#2 thread gives his OK. |
Please go ahead and merge. We have the go by @pfink-christ: |
rebased+merged in b549cb7 . Thanks! |
This PR documents the CAN-FD support that has been added to the
gs_usb
Linux driver and will hit mainline soon.This paves the road for other CAN-FD capable STM32 µC to implement CAN-FD support to their firmware.