Using low-speed with socketcan driver on USB to CAN v2

Hello.

This product works well using high-speed can with the socketcan driver. However, i want to use the low speed option on the CAN1 port in Linux using the socketcan driver. Is this possible? If so, how? There does not seem to be any possibility of setting low speed?

I have tested low-speed on Windows, and it works well there.

Any help would be greatly appreciated.

Hi Kent,

I’m escalating this to the development team to see if we have a driver able to do this

-Tim

Hi Kent,

The SocketCAN API can not change the mode dynamically, but you can adapt the driver.
Please search for the “can_opmode” in the file “ixx_usb_v2.c” and
add the flag " | IXXAT_USBV2_OPMODE_LOWSPEED " )

Thanks a lot Tim. This is exactly the sort of solution I was hoping for. I’ll give this a go as soon as I get back to the office.

However I do have a little concern, the current line where can_opmode is set reads like this:
u8 can_opmode = IXXAT_USBV2_OPMODE_EXTENDED | IXXAT_USBV2_OPMODE_STANDARD;

The already existing flags are defined like this:
#define IXXAT_USBV2_OPMODE_STANDARD 0x01 /* reception of 11-bit id messages */
#define IXXAT_USBV2_OPMODE_EXTENDED 0x02 /* reception of 29-bit id messages */

Won’t I need to define the lowspeed flag as well?

Hi Kent,

Here’s what my colleague sent me:

"I added the define IXXAT_USB_OPMODE_LOWSPEED BIT(4) in to the ixxat_usb_core.h

#define IXXAT_USB_OPMODE_LOWSPEED BIT(4)

In the attachment you can find the current Beta SocketCAN driver.

Please add the “| IXXAT_USBV2_OPMODE_LOWSPEED” to the opmode:

u8 opmode = IXXAT_USB_OPMODE_EXTENDED | IXXAT_USB_OPMODE_STANDARD | IXXAT_USBV2_OPMODE_LOWSPEED;"

SocketCAN_USB-to-CAN-V2_20180920_Modified_Linux_Kernel_5_11-with-Low-Speed-Flag.zip (19.3 KB)

This worked like a charm!

Thanks a lot Tim.

1 Like

Hi Kent,

Glad to hear it’s working!