USB to CAN V2 on Raspberry Pi4

Hi to everyone,
I would to connect the device in the title on the raspberry pi 4 for reading CAN message from a receiver. Is it possible to configure the device on PI4? In this case what driver should I use? thank you

Yes, it is possible. You want to use the ECI drivers for Linux:

You will find instructions inside the zip file. Are you using a Debian-based distribution like Raspbian?

Hi,
yes, I am using Raspbian. I installed the zip files but now I don’t know how to read the can messages. Sorry but I am not an expert of using Raspberry.

Folling the instructions,
I got an error when I compile the ECI Demo with the command make.

What error? You do not need to be a pro with Raspbian, but will need general Linux experience to be successful.

Keep in mind the system requirements:

  • IXXAT ECI Linux Driver
  • Gcc 4.2 and a working kernel build environment (for PCI(e) interfaces)
  • USB interfaces require the latest version (V2.X) of the bootmanager
  • libusb-0.1 0.1.12 or newer (for USB interfaces)
  • libusb-1.0 1.0.12-2 or newer (for USB-to-CAN V2)
  • libc6 2.3.4 or newer
  • libstdc++6 3.4 or newer
  • libgcc1 3.0 or newer
  • Code::Blocks IDE 8.02 or newer (optional)

Note:
The driver should work with most Linux distributions running a Kernel from 2.6.x up to 4.4.0,
but was only tested using Debian/Ubuntu and openSUSE Linux.

Hi, thanks for the help,
my problem, for now, us the kernel version of Linux and the linux -headers. I am not able to downgrade the kernel version to a release from 2.6 to 4.4 and find the linux - headers of the same version. How could I do this? thank you

I doubt that is the problem. I think it just lists 4.4 as the last version tested, but should work with newer kernels. However, I need to verify this.

I have confirmed that the latest ECI driver supports up to kernel v5.8.

Hi, thanks for the answer. On internet I found an user who used the SocketCan for Raspberry? Could I use it in this case for solving my problem? thank you

You can use the SocketCAN driver, but when using a Raspberry Pi with a standard kernel release, there are no kernel or header files available. This will require that the kernel is recompiled and installed on the device manually to allow the SocketCAN to function. Refer to the instructions provided at:

Another question, do the Eci Linux drivers work with 32 bit system?

Here is the correct driver for ARM64 for Raspberry Pi:

Here is the 32-bit version:

Hi @kyle_HMS,

Thank you for the support help with adding USB-to-CAN V2 support for the Raspberry Pi. I’ve read through the comments and tested out the ECI_Driver_1.13.3754.0_BETA_20200203_Linux_arm32 install. I was able to get the sudo make install-usb to complete successfully, but have not been able to get the system to auto-recognize the USB-to-CAN V2 as a CAN device for use with socketcan (and ultimately use it within python-can). Per the earlier comments, it seems like kernel rebuild might be necessary.

Have their been any updates since last year that you can share or perhaps an updated arm linux build? In hopes of me not needing to do a kernel rebuild.

My current kernel is 5.10.17-v7l+. Trying to run sudo make install I get the following error (though I don’t think this matters for me):

make -C /lib/modules/5.10.17-v7l+/build M=/home/pi/test/EciLinux_arm-hf/src/KernelModule modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.17-v7l+'
  CC [M]  /home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.o
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c: In function 'probe':
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c:2066:37: error: implicit declaration of function 'ioremap_nocache'; did you mean 'ioremap_cache'? [-Werror=implicit-function-declaration]
             pDeviceData->reg2vadd = ioremap_nocache( pDeviceData->reg2add, pDeviceData->reg2len );
                                     ^~~~~~~~~~~~~~~
                                     ioremap_cache
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c:2066:35: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
             pDeviceData->reg2vadd = ioremap_nocache( pDeviceData->reg2add, pDeviceData->reg2len );
                                   ^
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c:2150:25: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   pDeviceData->reg1vadd = ioremap_nocache( pDeviceData->reg1add, pDeviceData->reg1len );
                         ^
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c:2154:24: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   pDeviceData->memvadd = ioremap_nocache( pDeviceData->memadd, pDeviceData->memlen );
                        ^
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c: In function 'isa_add':
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c:2955:24: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
   pDeviceData->memvadd = ioremap_nocache( pDeviceData->memadd, pDeviceData->memlen );
                        ^
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c: In function 'isa_scan_iomem':
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c:3101:13: warning: assignment to 'unsigned char *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
       pByte = ioremap_nocache( addr, len );
             ^
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c: In function 'eci_km_init':
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c:3250:34: error: passing argument 4 of 'proc_create' from incompatible pointer type [-Werror=incompatible-pointer-types]
                                  &proc_file_fops);
                                  ^~~~~~~~~~~~~~~
In file included from /home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c:40:
./include/linux/proc_fs.h:109:24: note: expected 'const struct proc_ops *' but argument is of type 'const struct file_operations *'
 struct proc_dir_entry *proc_create(const char *name, umode_t mode, struct proc_dir_entry *parent, const struct proc_ops *proc_ops);
                        ^~~~~~~~~~~
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c: In function 'eci_read_info':
/home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.c:3217:3: warning: ignoring return value of 'copy_to_user', declared with attribute warn_unused_result [-Wunused-result]
   copy_to_user(buf, read_info, len);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:279: /home/pi/test/EciLinux_arm-hf/src/KernelModule/ecikm.o] Error 1
make[1]: *** [Makefile:1804: /home/pi/test/EciLinux_arm-hf/src/KernelModule] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.17-v7l+'
make: *** [Makefile:21: default] Error 2

Thanks,
Zac

  1. Please install the missing Linux headers using the following commands:

    sudo apt install raspberrypi-kernel-headers
    or
    sudo apt-get install linux-headers

  2. … tested out the ECI_Driver_1.13.3754.0_BETA_20200203_Linux_arm32 install.

I was able to get the sudo make install-usb to complete successfully,
but have not been able to get the system to auto-recognize the USB-to-CAN V2
as a CAN device for use with socketcan

The ECI and SocketCAN are different drivers (and APIs) and
they can not work on a PC simultaneously.
(Please uninstall the ECI driver before the installation of the SocketCAN driver.
Please uninstall the SocketCAN driver before the installation of the the ECI.)

  1. (and ultimately use it within python-can).

Please uninstall the ECI driver and install the attached SocketCAN driver.

SocketCAN_USB-to-CAN-V2_20180920_Modified_Linux_Kernel_5_11.zip (18.9 KB)

@kyle_HMS Thank you so much. That works! The README in the SocketCAN installer was very straightforward. Are these downloads publicly available or only here on the forum?

It is still a beta and has not been released yet - other downloads are available from the IXXAT support page and HMS Networks Github.

1 Like