Error codes of Chardev

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
Magnus.Zaza
Posts: 2
Joined: Mon 2. May 2022, 11:15

Error codes of Chardev

Post by Magnus.Zaza » Fri 5. Jul 2024, 10:55

I am using CAN Driver and Library API for Linux. This is the output of

Code: Select all

cat /proc/pcan
:

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20230330_n (8.16.0) Jul  4 2024 11:14:19 --------------
*------------------------- [mod] [pci] [pec] [usb] --------------------------
*--------------------- 4 interfaces @ major 237 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
 0  pcifd   -NA-  8991000 030 0x001c 001eea61 000f491d 000b46bb 00000000 0x0000
 1  pcifd   -NA-  8992000 030 0x011c 00057da5 000088ea 00030b17 00004b12 0x000c
 2  pcifd   -NA-  8993000 030 0x001c 00000001 00000000 00000001 00000000 0x0000
 3  pcifd   -NA-  8994000 030 0x001c 00000001 00000000 00000001 00000000 0x0000
I want to know what the error and the status codes mean. I checked pcan.h file but I can not find 0x000c nor 0x000d (which I got before)
I can find the following error codes:

0x0000 // no error
0x0001 // transmit buffer full
0x0002 // overrun in receive buffer
0x0004 // bus error, errorcounter limit reached
0x0008 // bus error, errorcounter limit reached
0x0010 // bus error, 'bus off' state entered
0x0020 // receive queue is empty
0x0040 // receive queue overrun
0x0080 // transmit queue full
0x0100 // test of controller registers failed
0x0200 // Win95/98/ME only
0x2000 // can't create resource
0x4000 // illegal parameter
0x8000 // value out of range
0x1C00 // wrong handle, handle error

Where to find 0x000c and 0x000d meanings?

Thanks in advance

M.Heidemann
Sales & Support
Sales & Support
Posts: 1083
Joined: Fri 20. Sep 2019, 13:31

Re: Error codes of Chardev

Post by M.Heidemann » Fri 5. Jul 2024, 11:28

Hello,

These values are combinations of two or more error codes,

so in your case:

0x000c = 0x0004 & 0x0008

0x000d = 0x0001 & 0x0004 & 0x0008

See also:

viewtopic.php?f=120&t=39

Best Regards

Marvin
---
Marvin Heidemann
PEAK-Support Team

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Error codes of Chardev

Post by PEAK-Support » Fri 5. Jul 2024, 11:32

please read the online help - there you found:
Note that the values of the different PCAN-Status definitions are able to be bitwise combined. In some cases it is possible to get more than one error code as result of calling a function.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply