Problem in Drivers installation under Linux-Kernel 3.2.0

This forum covers PCAN-Linux and Linux development issues concerning our products
matteo
Posts: 13
Joined: Wed 13. Aug 2014, 17:29

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by matteo » Fri 15. Aug 2014, 13:37

sorry, it seemed to work.
now i get messages like this

Code: Select all

x x 0x00000000 4  0x00 0x00 0x00 0x08                        155466769 065
that don't seem to contain data (apart from the last 2 fields these messages are always the same, even if the device is transmitting different values).
the massage rate is also very slow as weel.
...sorry for bothering that much
cheers
Matteo

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

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by PEAK-Support » Fri 15. Aug 2014, 15:48

could you please post exact what you started including the result. Only the result does not help. How could we answer if we do not know what you are doing?

For me it looks like a status message from the driver with error code 0x08

Code: Select all

#define CAN_ERR_BUSHEAVY       0x0008  // bus error, errorcounter limit reached
if it´s your code, did you checked the MsgType?

Code: Select all

// MSGTYPE bits of element MSGTYPE in structure TPCANMsg
#define MSGTYPE_STATUS        0x80     // used to mark a status TPCANMsg
#define MSGTYPE_EXTENDED      0x02     // declares a extended frame
#define MSGTYPE_RTR           0x01     // marks a remote frame
#define MSGTYPE_STANDARD      0x00     // marks a standard frame
Always when you receive a CAN Frame from the driver you need check if it is a real CAN Message with valid Data, or if it is a Status Message.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

matteo
Posts: 13
Joined: Wed 13. Aug 2014, 17:29

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by matteo » Mon 18. Aug 2014, 13:05

sorry, maybe I was not clear. I get

Code: Select all

x x 0x00000000 4  0x00 0x00 0x00 0x08                        155466769 065
after

Code: Select all

cat /dev/pcan32
.
How can I display the TPCANMsg structure? sorry but the guide is not very clear to me...
thanks again

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

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by PEAK-Support » Mon 18. Aug 2014, 13:54

Code: Select all

x x 0x00000000 4  0x00 0x00 0x00 0x08 
is the ouput of the structure on the console. if you like to see the structure as structure - use a debugger and debug the receivetest.c or any other sample.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

matteo
Posts: 13
Joined: Wed 13. Aug 2014, 17:29

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by matteo » Mon 18. Aug 2014, 14:35

Dear Wihlelm,
you have been very nice to me so far, since, maybe, i'm asking stupid questions
...but sorry, it's my fisrt time with CAN applications.
so,...I receive the structure i reported on the post: on the guide the explanation of it is not that clear, at least to me.
Btw, I guess the explanation is this

Code: Select all

*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
0 pci can2 f7d00000 209 0x001c 00000000 00000000 00000000 00000000 0x0000
..am I right?
if so, in my case the last two fields (error and status) are not displayed at all.
how can i get the msgtype and consequentIy the error? ( reported on this topic all the infos i have...) :(

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

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by PEAK-Support » Mon 18. Aug 2014, 16:34

Hmm...no i am confused...

Code: Select all

*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
0 pci can2 f7d00000 209 0x001c 00000000 00000000 00000000 00000000 0x0000
you post now a list of an installed driver for a SocketCAN PCI CAN card ?
Could you please go step by step...
you have a PCAN-USB - right?
you have installed as CharDev - right?
you have compiled also the samples - right?
if you have all this done - it look s like this when you type
cat /proc/pcan

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20140723_n (7.12.0) Aug 13 2014 18:20:29 --------------
*---------------- [mod] [isa] [pci] [dng] [par] [usb] [pcc] -----------------
*--------------------- 1 interfaces @ major 250 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32    usb -NA- ffffffff 255 0x001c 00000000 00000000 0000010c 00000000 0x0000
this shows you that the ChgarDev driver is installed and one PCAN-USB is detected.
It does not show you any CAN Messages - its the list of the instlled devices and which driver type is used.

Now you could see if on the CAN Bus are any messages by typing
cat /dev/pcan32
This post all incomming messages to your console - if there are only errors - you see the errors (see my last post) - if there are nothing - you see nothing.
Try to use the receivetest which comes with the samples and study the source code, but up in front try to understand how the CAN-Bus work, what a CAN Message looks like, etc. This forum is for CAN users - the Linux driver for Linux users. We are not able to make basic support for beginners- sorry - you need to read manuals.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

matteo
Posts: 13
Joined: Wed 13. Aug 2014, 17:29

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by matteo » Mon 18. Aug 2014, 17:36

Could you please go step by step...
you have a PCAN-USB - right?
you have installed as CharDev - right?
you have compiled also the samples - right?
if you have all this done - it look s like this when you type
cat /proc/pcan

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20140723_n (7.12.0) Aug 13 2014 18:20:29 --------------
*---------------- [mod] [isa] [pci] [dng] [par] [usb] [pcc] -----------------
*--------------------- 1 interfaces @ major 250 found -----------------------
*n -type- ndev --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32    usb -NA- ffffffff 255 0x001c 00000000 00000000 0000010c 00000000 0x0000
this shows you that the ChgarDev driver is installed and one PCAN-USB is detected.
It does not show you any CAN Messages - its the list of the instlled devices and which driver type is used.
So far so good.
Now you could see if on the CAN Bus are any messages by typing
cat /dev/pcan32
This post all incomming messages to your console - if there are only errors - you see the errors (see my last post) - if there are nothing - you see nothing.
when i do that I receive

Code: Select all

x x 0x00000000 4  0x00 0x00 0x00 0x08                        155466769 065
that doesn't look like a message...i have to interpret it if i whant to undertand the error i am doing and fix it..on the guide i don't mahage to find smt similar to that!
Try to use the receivetest which comes with the samples and study the source code, but up in front try to understand how the CAN-Bus work, what a CAN Message looks like, etc. This forum is for CAN users - the Linux driver for Linux users. We are not able to make basic support for beginners- sorry - you need to read manuals.
you are definitely right but i want just to understand which problem i have..and this interpretation depends on your product

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

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by M.Maidhof » Tue 19. Aug 2014, 09:44

Hi,

you see a status message which will tell you that the CAN-Controller is in busheavy state (Byte[3] =0x08). The reason for this is the 500k baudrate you are still using on the PCAN-USB. In an earlier post you told us your external device uses 1Mbit/s. So you have to set the same baudrate in PCAN-USB using the echo command.

Please remember the following post: http://www.peak-system.com/forum/viewto ... 1162#p3171

regards

Michael

matteo
Posts: 13
Joined: Wed 13. Aug 2014, 17:29

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by matteo » Tue 19. Aug 2014, 19:34

hi,
I did it in fact...sometimes either i get Nothing or

Code: Select all

m s 0x000002d0 6  0x01 0x01 0x00 0x01 0x00 0x00              516492425 570
.
I guess it is another error. I would like not to bother you and to find out the solution myself: to to that I need to know whether there is around a clear explanation of the type of messages i can receive, explanation of the structure and respective fields etc.
that's it..
thank you very much
best

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

Re: Problem in Drivers installation under Linux-Kernel 3.2.0

Post by M.Maidhof » Wed 20. Aug 2014, 09:37

Hi,

the error codes and the status message system of the libpcan (Linux) is based on the older PCAN-Light API of Windows. You can download the PCAN-Light API package for Windows from our support website. There you will find the description of all error codes in the chm help files:
Errorcodes-PCAN-Light.JPG
Errorcodes-PCAN-Light.JPG (186.56 KiB) Viewed 13567 times
Now you have received a real CAN message, so all seems to be ok, isn´t it?

It will be helpfull to get the output of cat/proc/pcan from your system, but this time not a faked one like last time.... ;)

regards

Michael

Post Reply