* candump error flags
@ 2014-11-07 13:57 Paul Lever
2014-11-07 14:13 ` Andri Yngvason
2014-11-07 14:30 ` Marc Kleine-Budde
0 siblings, 2 replies; 17+ messages in thread
From: Paul Lever @ 2014-11-07 13:57 UTC (permalink / raw)
To: linux-can
I'm trying to use the candump -e and -d options to catch errors. I
know that frames are being dropped, as I can see missing packets in
known sequences, yet I never see anything printed from candump
indicating any errors or dropped packets. Is there additional steps
needed to get output from -e/-d options? This is on a Beaglebone Black
platform.
My cmd line is:
candump -t a -e -d -r 16000 can0 > /media/testdata.raw&
Regards
Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-07 13:57 candump error flags Paul Lever
@ 2014-11-07 14:13 ` Andri Yngvason
2014-11-07 14:30 ` Marc Kleine-Budde
1 sibling, 0 replies; 17+ messages in thread
From: Andri Yngvason @ 2014-11-07 14:13 UTC (permalink / raw)
To: Paul Lever; +Cc: linux-can
On Fri, Nov 07, 2014 at 09:57:41AM -0400, Paul Lever wrote:
> I'm trying to use the candump -e and -d options to catch errors. I
> know that frames are being dropped, as I can see missing packets in
> known sequences, yet I never see anything printed from candump
> indicating any errors or dropped packets. Is there additional steps
> needed to get output from -e/-d options? This is on a Beaglebone Black
> platform.
> My cmd line is:
> candump -t a -e -d -r 16000 can0 > /media/testdata.raw&
>
Hi Paul,
Error handling is different between platforms. On some platforms you need to
enable berr-reporting to get errors. Some platforms support a limited set of
errors (or even no errors at all?)
You can grep for "CAN_ERR" in the driver for your platform to find out which
errors are implemented.
--
Cheers,
Andri
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-07 13:57 candump error flags Paul Lever
2014-11-07 14:13 ` Andri Yngvason
@ 2014-11-07 14:30 ` Marc Kleine-Budde
2014-11-07 14:56 ` Oliver Hartkopp
1 sibling, 1 reply; 17+ messages in thread
From: Marc Kleine-Budde @ 2014-11-07 14:30 UTC (permalink / raw)
To: Paul Lever, linux-can
[-- Attachment #1: Type: text/plain, Size: 878 bytes --]
On 11/07/2014 02:57 PM, Paul Lever wrote:
> I'm trying to use the candump -e and -d options to catch errors. I
> know that frames are being dropped, as I can see missing packets in
> known sequences, yet I never see anything printed from candump
> indicating any errors or dropped packets. Is there additional steps
> needed to get output from -e/-d options? This is on a Beaglebone Black
> platform.
> My cmd line is:
> candump -t a -e -d -r 16000 can0 > /media/testdata.raw&
Make sure you're running a recent new kernel (v3.15 or better) as a lot
of fixes went into the driver.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-07 14:30 ` Marc Kleine-Budde
@ 2014-11-07 14:56 ` Oliver Hartkopp
2014-11-08 14:47 ` Paul Lever
0 siblings, 1 reply; 17+ messages in thread
From: Oliver Hartkopp @ 2014-11-07 14:56 UTC (permalink / raw)
To: Marc Kleine-Budde, Paul Lever, linux-can
On 07.11.2014 15:30, Marc Kleine-Budde wrote:
> On 11/07/2014 02:57 PM, Paul Lever wrote:
>> I'm trying to use the candump -e and -d options to catch errors. I
>> know that frames are being dropped, as I can see missing packets in
>> known sequences, yet I never see anything printed from candump
>> indicating any errors or dropped packets. Is there additional steps
>> needed to get output from -e/-d options? This is on a Beaglebone Black
>> platform.
>> My cmd line is:
>> candump -t a -e -d -r 16000 can0 > /media/testdata.raw&
>
> Make sure you're running a recent new kernel (v3.15 or better) as a lot
> of fixes went into the driver.
>
E.g. the dropcount functionality emerged in Linux 2.6.33
So a Debian Squeeze with 2.6.32 won't make it here ...
Regards,
Oliver
ps. additionally "candump -r 16000 -l can0 &" would be better :-)
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-07 14:56 ` Oliver Hartkopp
@ 2014-11-08 14:47 ` Paul Lever
2014-11-08 15:00 ` Oliver Hartkopp
0 siblings, 1 reply; 17+ messages in thread
From: Paul Lever @ 2014-11-08 14:47 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: Marc Kleine-Budde, linux-can
>> Make sure you're running a recent new kernel (v3.15 or better) as a lot
>> of fixes went into the driver.
>>
>
> E.g. the dropcount functionality emerged in Linux 2.6.33
> So a Debian Squeeze with 2.6.32 won't make it here ...
I am running the c_can driver with the updates to late June.
> ps. additionally "candump -r 16000 -l can0 &" would be better :-)
I need the timestamps.
With berr-reporting enabled I still don't see any messages generated
by the -e and -d options to candump. Looking at my received data I can
see that there are missing sequential packets.
Regards
Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-08 14:47 ` Paul Lever
@ 2014-11-08 15:00 ` Oliver Hartkopp
2014-11-08 15:14 ` Paul Lever
0 siblings, 1 reply; 17+ messages in thread
From: Oliver Hartkopp @ 2014-11-08 15:00 UTC (permalink / raw)
To: Paul Lever; +Cc: Marc Kleine-Budde, linux-can
On 11/08/2014 03:47 PM, Paul Lever wrote:
>>> Make sure you're running a recent new kernel (v3.15 or better) as a lot
>>> of fixes went into the driver.
>>>
>>
>> E.g. the dropcount functionality emerged in Linux 2.6.33
>> So a Debian Squeeze with 2.6.32 won't make it here ...
> I am running the c_can driver with the updates to late June.
Of which kernel version?
A 2.6.32.x with security and stable patches is still no 2.6.33+
>> ps. additionally "candump -r 16000 -l can0 &" would be better :-)
> I need the timestamps.
The logfile format contains a unix timestamp (usec resolution) for every CAN
frame (and error message).
>
> With berr-reporting enabled I still don't see any messages generated
> by the -e and -d options to candump. Looking at my received data I can
> see that there are missing sequential packets.
I'll better wait for the kernel version until answering based on assumptions.
Regards,
Oliver
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-08 15:00 ` Oliver Hartkopp
@ 2014-11-08 15:14 ` Paul Lever
2014-11-08 15:29 ` Oliver Hartkopp
2014-11-08 16:46 ` Marc Kleine-Budde
0 siblings, 2 replies; 17+ messages in thread
From: Paul Lever @ 2014-11-08 15:14 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: Marc Kleine-Budde, linux-can
>>> ps. additionally "candump -r 16000 -l can0 &" would be better :-)
>> I need the timestamps.
>
> The logfile format contains a unix timestamp (usec resolution) for every CAN
> frame (and error message).
Correct if I use the -t option. I was just commenting on the
suggestion not to use the option. Not sure why it was suggested.
> I'll better wait for the kernel version until answering based on assumptions.
The kernel is
Image Name: Linux-3.12.9-00111-gcad6b9e
with an updated c_can driver.
Regards
Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-08 15:14 ` Paul Lever
@ 2014-11-08 15:29 ` Oliver Hartkopp
2014-11-08 15:34 ` Paul Lever
2014-11-08 16:46 ` Marc Kleine-Budde
1 sibling, 1 reply; 17+ messages in thread
From: Oliver Hartkopp @ 2014-11-08 15:29 UTC (permalink / raw)
To: Paul Lever; +Cc: Marc Kleine-Budde, linux-can
On 11/08/2014 04:14 PM, Paul Lever wrote:
>>>> ps. additionally "candump -r 16000 -l can0 &" would be better :-)
>>> I need the timestamps.
>>
>> The logfile format contains a unix timestamp (usec resolution) for every CAN
>> frame (and error message).
> Correct if I use the -t option. I was just commenting on the
> suggestion not to use the option. Not sure why it was suggested.
>
Hm. No.
The -l option creates a logfile with the current date/time in the current
directory. The '-L' option puts the logfile format to the stdout.
Both of them contain a timestamp for all CAN frames and error messages.
No need for '-t?' in these cases.
>> I'll better wait for the kernel version until answering based on assumptions.
> The kernel is
> Image Name: Linux-3.12.9-00111-gcad6b9e
> with an updated c_can driver.
In this case the -d option should work.
But just for the records: The -d option detects drops from the network layer
to the application which opened the socket (here: candump).
So it basically detects problems when your user space application is not fast
enough to read and handle the CAN frames. It does NOT detect whether the CAN
driver dropped any frames.
Regards,
Oliver
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-08 15:29 ` Oliver Hartkopp
@ 2014-11-08 15:34 ` Paul Lever
2014-11-08 16:44 ` Oliver Hartkopp
0 siblings, 1 reply; 17+ messages in thread
From: Paul Lever @ 2014-11-08 15:34 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: Marc Kleine-Budde, linux-can
> In this case the -d option should work.
> But just for the records: The -d option detects drops from the network layer
> to the application which opened the socket (here: candump).
>
> So it basically detects problems when your user space application is not fast
> enough to read and handle the CAN frames. It does NOT detect whether the CAN
> driver dropped any frames.
Thanks for the info. Is there an easy way to detect driver level
packet drops or overruns?The CANBUS is at 250,000 bitrate.
Regards
Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-08 15:34 ` Paul Lever
@ 2014-11-08 16:44 ` Oliver Hartkopp
2014-11-09 14:50 ` Paul Lever
0 siblings, 1 reply; 17+ messages in thread
From: Oliver Hartkopp @ 2014-11-08 16:44 UTC (permalink / raw)
To: Paul Lever; +Cc: Marc Kleine-Budde, linux-can
On 11/08/2014 04:34 PM, Paul Lever wrote:
>> In this case the -d option should work.
>> But just for the records: The -d option detects drops from the network layer
>> to the application which opened the socket (here: candump).
>>
>> So it basically detects problems when your user space application is not fast
>> enough to read and handle the CAN frames. It does NOT detect whether the CAN
>> driver dropped any frames.
>
>
> Thanks for the info. Is there an easy way to detect driver level
> packet drops or overruns?The CANBUS is at 250,000 bitrate.
When the CAN driver supports it, there's a bit in the error message
CAN_ERR_CRTL_RX_OVERFLOW
for that.
See:
http://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/include/uapi/linux/can/error.h?h=linux-3.17.y#n63
Looking for it in the tree:
http://lxr.free-electrons.com/ident?i=CAN_ERR_CRTL_RX_OVERFLOW
It is used in c_can_handle_lost_msg_obj()
http://lxr.free-electrons.com/source/drivers/net/can/c_can/c_can.c#L348
So it should also increase rx_errors and rx_over_errors.
I'm not familiar with c_can - but can you see these statistics increasing the
values in your setup?
ip -stats link show can0
should display them.
Regards,
Oliver
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-08 15:14 ` Paul Lever
2014-11-08 15:29 ` Oliver Hartkopp
@ 2014-11-08 16:46 ` Marc Kleine-Budde
2014-11-09 14:52 ` Paul Lever
1 sibling, 1 reply; 17+ messages in thread
From: Marc Kleine-Budde @ 2014-11-08 16:46 UTC (permalink / raw)
To: Paul Lever, Oliver Hartkopp; +Cc: linux-can
[-- Attachment #1: Type: text/plain, Size: 876 bytes --]
On 11/08/2014 04:14 PM, Paul Lever wrote:
>>>> ps. additionally "candump -r 16000 -l can0 &" would be better :-)
>>> I need the timestamps.
>>
>> The logfile format contains a unix timestamp (usec resolution) for every CAN
>> frame (and error message).
> Correct if I use the -t option. I was just commenting on the
> suggestion not to use the option. Not sure why it was suggested.
>
>
>> I'll better wait for the kernel version until answering based on assumptions.
> The kernel is
> Image Name: Linux-3.12.9-00111-gcad6b9e
As I said, make sue you use at least v3.15.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-08 16:44 ` Oliver Hartkopp
@ 2014-11-09 14:50 ` Paul Lever
0 siblings, 0 replies; 17+ messages in thread
From: Paul Lever @ 2014-11-09 14:50 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: Marc Kleine-Budde, linux-can
> I'm not familiar with c_can - but can you see these statistics increasing the
> values in your setup?
>
> ip -stats link show can0
>
> should display them.
Yes, they are shown in the stats:
ip -stats link show can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state
UNKNOWN mode DEFAULT group default qlen 10
link/can
RX: bytes packets errors dropped overrun mcast
619176 77397 71192 37270 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
I'm just not seeing any from the candump listing.
Thanks again for the info
Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-08 16:46 ` Marc Kleine-Budde
@ 2014-11-09 14:52 ` Paul Lever
2014-11-09 15:01 ` Marc Kleine-Budde
0 siblings, 1 reply; 17+ messages in thread
From: Paul Lever @ 2014-11-09 14:52 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: Oliver Hartkopp, linux-can
> As I said, make sue you use at least v3.15.
Understood. At this time I'm stuck with the release I'm using,
although I can update CAN drivers, etc. I won't be able to migrate to
a latter OS build for a few months.
Regards
Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-09 14:52 ` Paul Lever
@ 2014-11-09 15:01 ` Marc Kleine-Budde
2014-11-09 15:23 ` Paul Lever
0 siblings, 1 reply; 17+ messages in thread
From: Marc Kleine-Budde @ 2014-11-09 15:01 UTC (permalink / raw)
To: Paul Lever; +Cc: Oliver Hartkopp, linux-can
[-- Attachment #1: Type: text/plain, Size: 647 bytes --]
On 11/09/2014 03:52 PM, Paul Lever wrote:
>> As I said, make sue you use at least v3.15.
> Understood. At this time I'm stuck with the release I'm using,
> although I can update CAN drivers, etc. I won't be able to migrate to
> a latter OS build for a few months.
There are more than 50 patches between v3.12 and current net/master on
the c_can driver.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
* Re: candump error flags
2014-11-09 15:01 ` Marc Kleine-Budde
@ 2014-11-09 15:23 ` Paul Lever
2014-11-10 5:29 ` Pankajkumar Misra (RBEI/EEA2)
0 siblings, 1 reply; 17+ messages in thread
From: Paul Lever @ 2014-11-09 15:23 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: Oliver Hartkopp, linux-can
> There are more than 50 patches between v3.12 and current net/master on
> the c_can driver.
Yes. I updated to the major c_can driver re-write patches (I think
those were in April) through June this year. If I need to I'll update
the c_can driver to the latest.
Regards
Paul
^ permalink raw reply [flat|nested] 17+ messages in thread
* RE: candump error flags
2014-11-09 15:23 ` Paul Lever
@ 2014-11-10 5:29 ` Pankajkumar Misra (RBEI/EEA2)
2014-11-13 10:20 ` mcp251x (was: Re: candump error flags) Marc Kleine-Budde
0 siblings, 1 reply; 17+ messages in thread
From: Pankajkumar Misra (RBEI/EEA2) @ 2014-11-10 5:29 UTC (permalink / raw)
To: Paul Lever, Marc Kleine-Budde, linux-can@vger.kernel.org; +Cc: Oliver Hartkopp
Hi,
Are there any patches available for MCP251x module.
I am using it on Olimex board with spi interface.
I am getting bus-off very often & also not able to set any other baud rate than 250KBPS.
Best Regards,
Pankaj
-----Original Message-----
From: linux-can-owner@vger.kernel.org [mailto:linux-can-owner@vger.kernel.org] On Behalf Of Paul Lever
Sent: 09 नवम्बर 2014 20:53
To: Marc Kleine-Budde
Cc: Oliver Hartkopp; linux-can@vger.kernel.org
Subject: Re: candump error flags
> There are more than 50 patches between v3.12 and current net/master on
> the c_can driver.
Yes. I updated to the major c_can driver re-write patches (I think
those were in April) through June this year. If I need to I'll update
the c_can driver to the latest.
Regards
Paul
--
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 17+ messages in thread
* mcp251x (was: Re: candump error flags)
2014-11-10 5:29 ` Pankajkumar Misra (RBEI/EEA2)
@ 2014-11-13 10:20 ` Marc Kleine-Budde
0 siblings, 0 replies; 17+ messages in thread
From: Marc Kleine-Budde @ 2014-11-13 10:20 UTC (permalink / raw)
To: Pankajkumar Misra (RBEI/EEA2), Paul Lever,
linux-can@vger.kernel.org
Cc: Oliver Hartkopp
[-- Attachment #1: Type: text/plain, Size: 791 bytes --]
Hey Pankajkumar,
please start a new thread, when starting a new topic.
On 11/10/2014 06:29 AM, Pankajkumar Misra (RBEI/EEA2) wrote:
> Are there any patches available for MCP251x module.
> I am using it on Olimex board with spi interface.
Any patched compared to which Kernel version?
> I am getting bus-off very often & also not able to set any other baud
> rate than 250KBPS.
Which driver are you using? The mcp251x chips are not the best CAN chips
to be used on a Linux based system.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 17+ messages in thread
end of thread, other threads:[~2014-11-13 10:20 UTC | newest]
Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-07 13:57 candump error flags Paul Lever
2014-11-07 14:13 ` Andri Yngvason
2014-11-07 14:30 ` Marc Kleine-Budde
2014-11-07 14:56 ` Oliver Hartkopp
2014-11-08 14:47 ` Paul Lever
2014-11-08 15:00 ` Oliver Hartkopp
2014-11-08 15:14 ` Paul Lever
2014-11-08 15:29 ` Oliver Hartkopp
2014-11-08 15:34 ` Paul Lever
2014-11-08 16:44 ` Oliver Hartkopp
2014-11-09 14:50 ` Paul Lever
2014-11-08 16:46 ` Marc Kleine-Budde
2014-11-09 14:52 ` Paul Lever
2014-11-09 15:01 ` Marc Kleine-Budde
2014-11-09 15:23 ` Paul Lever
2014-11-10 5:29 ` Pankajkumar Misra (RBEI/EEA2)
2014-11-13 10:20 ` mcp251x (was: Re: candump error flags) Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).