occasionally getting Error on CAN channels

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
altran
Posts: 14
Joined: Sat 5. Nov 2016, 07:11

occasionally getting Error on CAN channels

Post by altran » Tue 27. Dec 2016, 23:05

Hi,

I have some code that allows me to read data off multiple CAN buses (I have 4 PCAN-USB Pro FD devices); however, sometimes I would be unable to read from some of the CAN buses and I would have to unplug and replug the devices to get it to reset. (Is there any way I can reset the channel without unplugging the USB??)

Here is what cat /proc/pcan looks like prior to unplugging the devices, what is status 0x0002? It looks like I am getting errors.

Code: Select all

*------------- PEAK-System CAN interfaces (http://www.peak-system.com) -------------
*------------- Release_20161108_n (8.2.0) Dec 22 2016 14:19:48 --------------
*------------- [mod] [isa] [pci] [pec] [dng] [par] [usb] [pcc] --------------
*--------------------- 8 interfaces @ major 241 found -----------------------
*n -type- -ndev---base-- irq --btr-          --read--    --write-       --irqs--    -errors-  status
32  usbfd   -NA- ffffffff 004 0x001c 00000000 00000000 00000000 00007e6d 0x0002
33  usbfd   -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00007e32 0x0002
34  usbfd   -NA- ffffffff 003 0x001c 00000000 00000000 00000000 00007dfd 0x0002
35  usbfd   -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00007dc2 0x0002
36  usbfd   -NA- ffffffff 002 0x001c 00000058 00000003 0000005b 00000000 0x0000
37  usbfd   -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00007cd2 0x0002
38  usbfd   -NA- ffffffff 001 0x001c 00000000 00000000 00000000 0000525b 0x0002
39  usbfd   -NA- ffffffff 255 0x001c 00000000 00000000 00000000 00007c59 0x0002
Last edited by M.Gerber on Thu 5. Jan 2017, 14:38, edited 1 time in total.
Reason: Inserted [code] tags for better readability.

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: occasionally getting Error on CAN channels

Post by M.Maidhof » Thu 19. Jan 2017, 09:28

Hi,

when the CAN controller in the PCAN-USB-Pro FD runs into a BUSOFF state, you have to call CAN_INIT() again to reset the CAN controller again. No need to unplug the hardware in that case. Please also check that your used USB hub is powered and that you have enough power to supply 4 PCAN-USB-Pro on your system. Have a look in dmesg, to see if there are warnings.

regards

Michael

Post Reply