I have a small application that utilizes a PEAK CAN USB adapter to communicate with a Bootloader on a embedded device. The small application works flawless with the very same adapter with the very same cable setup on a MacBook (and I know of customers who used the same application on windows).
Now, I try to port the application to Linux. I run a Ubuntu in VMWare virtual machine:
The required drivers seem to be preinstalled with the OS, as promised:uname -a
Linux ubuntu 5.15.0-46-generic #49~20.04.1-Ubuntu SMP Thu Aug 4 19:15:44 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
And the CAN device seems to be initialized:$ grep PEAK_ /boot/config-`uname -r`
CONFIG_CAN_PEAK_PCIEFD=m
CONFIG_CAN_PEAK_PCI=m
CONFIG_CAN_PEAK_PCIEC=y
CONFIG_CAN_PEAK_PCMCIA=m
CONFIG_CAN_PEAK_USB=m
The CAN device is poweres (see attached foto). But, when calling `CAN_Initialize()` in the application, it fails:$ lsmod | grep ^peak
peak_usb 53248 0
The pcanbasic_dbg.log:Tue Aug 16 00:12:14 2022 - «____________________________________»
Tue Aug 16 00:12:14 2022 - « PCAN-Basic Log »
Tue Aug 16 00:12:14 2022 - « API v4.6.1.32 »
Tue Aug 16 00:12:14 2022 - «____________________________________»
Tue Aug 16 00:12:14 2022 - PCAN Library Logging Enabled.
Tue Aug 16 00:12:14 2022 - EXIT 'CAN_SetValue' - RESULT: 0x00
Tue Aug 16 00:12:14 2022 - ENTRY 'CAN_Initialize'
Tue Aug 16 00:12:14 2022 - PARAMETERS of CAN_Initialize: Channel: 0x51, Btr0Btr1: 28, HwType: 0x00000000, IOPort: 0x00000000, Interrupt: 0x00000000
Tue Aug 16 00:12:14 2022 - EXIT 'CAN_Initialize' - RESULT: 0x1400
Tue Aug 16 00:12:14 2022 - «____________________________________»
Tue Aug 16 00:12:14 2022 - « ############ »
Tue Aug 16 00:12:14 2022 - «____________________________________»
Here the result of `cat /proc/pcan`0000013646.756597: Initializing PCAN-Basic API...
0000013646.756648: Refreshing hardware device list...
0000013646.756669: ERROR: failed to scan directory (errno=2) '/sys/class/pcan'
0000013646.756674: Found 0 devices in '/sys/class/pcan'
0000013646.756686: ERROR: failed to open file (errno=2) '/sys/class/pcan/version'.
0000013646.772595: Cleaning up PCAN-Basic API...
When I connect the CAN device to the host machine of the VM, VMWare asks me if I want to connect the CAN device to the VM and I agree to it (see attached picture).$ cat /proc/pcan
cat: /proc/pcan: No such file or directory
What could be the problem here? What further investigations do I have to make? Is Ubunut even supported by PEAK?
best regards,
Torsten