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

5Mbps data bitrate not working #4

Open
normaldotcom opened this issue Nov 1, 2021 · 2 comments
Open

5Mbps data bitrate not working #4

normaldotcom opened this issue Nov 1, 2021 · 2 comments

Comments

@normaldotcom
Copy link

Not sure if this is an issue with the Cantact Pro firmware or the gs_usb_fd driver, but I can't generate a 5mbit CANFD data bitrate. I haven't tested this extensively, hopefully I can do some more testing soon.

Test case:

  • CANtact Pro with CAN0 connected to CAN1
  • Both interfaces brought up with the same bitrates:
    • 1Mbps standard bitrate
    • 5Mbps data bitrate
  • Using gs_usb_fd driver at your latest commit linklayer/gs_usb_fd@76af2fd

Result:
Repeated TX of packet that does not appear to have anything in the data portion of the packet, after some attempts it appears to give up on TXing packets that are not ACKed.

Scope Shot
SDS00001

@moechr
Copy link

moechr commented Nov 25, 2021

Have you successfully tested other/slower data bitrates on the cantact yet?
Assuming you probed CAN_L it seems that the "receiving" CAN node is destroying the transmit by sending an error frame.
More details are harsh to see due to bad screen representation.
FD without BRS works?

@marckleinebudde
Copy link

marckleinebudde commented Dec 30, 2021

Hey @normaldotcom,

I've changed the clocking of the CAN cores in the CANtact, they are now clocked with 40 MHz not 24 MHz. If you want to test it. This procedure works for me, hopefully you will not brick your device:

  • unplug
  • press and hold the button next to USB connector
  • plug USB

Now the light should be quite dimm. The device should show up as an USB mass storage device:

  • mount USB mass storage
  • make a copy of the firmware.bin in a secure place (that's the original FW)
  • erase the firmware.bin
  • extract the attached firmware.zip somewhere else (e.g. /tmp)
  • copy the new firmware.bin to the mounted USB mass storage
  • unmount
  • unplug + plug form USB

You can check with ip if the new firmware is active:

$ ip -details -statistic link show can0
9: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
    link/can  promiscuity 0 minmtu 0 maxmtu 0
    can state ERROR-ACTIVE restart-ms 1000
          bitrate 500000 sample-point 0.875
          tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
          gs_usb: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..1024 brp-inc 1
          gs_usb: dtseg1 1..16 dtseg2 1..8 dsjw 1..4 dbrp 1..1024 dbrp-inc 1
          clock 40000000

The new firmware has a clock of 40000000 the original one uses 24000000.

          re-started bus-errors arbit-lost error-warn error-pass bus-off
          0          0          0          0          0          0         numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
    RX: bytes  packets  errors  dropped missed  mcast
    0          0        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    0          0        0       0       0       0

firmware.zip

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

No branches or pull requests

3 participants