Linux CAN drivers development
 help / color / mirror / Atom feed
From: ajneu <ajneu1@gmail.com>
To: linux-can@vger.kernel.org
Subject: Bug? -- NEVER getting controller-problem{back-to-error-active}
Date: Mon, 20 Jun 2016 09:12:07 +0000 (UTC)	[thread overview]
Message-ID: <loom.20160620T110554-742@post.gmane.org> (raw)

Hi,

I'm using a PEAK USB Adapter (PCAN-USB FD) for normal CAN Frames (standard
format), and lsmod shows peak_usb as it should.

When running on a can bus and continually send out messages (one frame each
second).
But there is no other participant, so I will get NO ACK.


So berr-counter-tx counts up until it reaches
96:
-> enter state ERROR-WARNING.

   I then get a frame:
   Error: 
	Id  : 0x20000004
	Data: 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 
	controller-problem{tx-error-warning}


Then berr-counter-tx continues to count up to 
128:
-> enter state ERROR-PASSIVE.

   I then get a frame:
   Error: 
	Id  : 0x20000004
	Data: 0x0 0x20 0x0 0x0 0x0 0x0 0x0 0x0 
	controller-problem{tx-error-passive}


Then if I connect another participant, berr-counter-tx counter will start
decrementing (bec. of successfull ACK)
When berr-counter-tx is 
127:
-> enter state ERROR_WARNING.

   I then get a frame:
   Error: 
	Id  : 0x20000004
	Data: 0x0 0x8 0x0 0x0 0x0 0x0 0x0 0x0 
	controller-problem{tx-error-warning}


When berr-counter-tx reaches 
95: 
-> enter state ERROR_ACTIVE

BUT I NEVER GET the frame
	Id  : 0x20000004
	Data: 0x0 0x40 0x0 0x0 0x0 0x0 0x0 0x0 
	controller-problem{back-to-error-active}
WHY?
WHY DO I NOT GET THAT FRAME?
IS THIS A BUG???


The command
   ip -details link show can0     
shows...

3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode
DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-ACTIVE (berr-counter tx 94 rx 80) restart-ms 0
          bitrate 250000 sample-point 0.875
          tq 62 prop-seg 27 phase-seg1 28 phase-seg2 8 sjw 1
          pcan_usb_fd: tseg1 1..64 tseg2 1..16 sjw 1..16 brp 1..1024 brp-inc 1
          pcan_usb_fd: dtseg1 1..16 dtseg2 1..8 dsjw 1..4 dbrp 1..1024
dbrp-inc 1
          clock 80000000

...so I'm definately in error-active.
(But I never received back-to-error-active. Why? Is this a bug?)

Thanks.
ajneu



PS:
------------------------------------
When berr-counter-tx switches from 96 to
95:
and I then do command
   ip -details link show can0     
it shows...

3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode
DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
          bitrate 250000 sample-point 0.875
          tq 62 prop-seg 27 phase-seg1 28 phase-seg2 8 sjw 1
          pcan_usb_fd: tseg1 1..64 tseg2 1..16 sjw 1..16 brp 1..1024 brp-inc 1
          pcan_usb_fd: dtseg1 1..16 dtseg2 1..8 dsjw 1..4 dbrp 1..1024
dbrp-inc 1
          clock 80000000


That ALSO SEEMS TO BE A BUG. I expect berr-counter-tx to be 95 and not 0 as
shown.
But when berr-counter-tx decrements one more, I get 

3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode
DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-ACTIVE (berr-counter tx 94 rx 80) restart-ms 0
          bitrate 250000 sample-point 0.875
          tq 62 prop-seg 27 phase-seg1 28 phase-seg2 8 sjw 1
          pcan_usb_fd: tseg1 1..64 tseg2 1..16 sjw 1..16 brp 1..1024 brp-inc 1
          pcan_usb_fd: dtseg1 1..16 dtseg2 1..8 dsjw 1..4 dbrp 1..1024
dbrp-inc 1
          clock 80000000




             reply	other threads:[~2016-06-20  9:12 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20  9:12 ajneu [this message]
2016-06-20  9:22 ` Bug? -- NEVER getting controller-problem{back-to-error-active} ajneu
2016-06-20 10:33 ` Wolfgang Grandegger
2016-06-20 12:41   ` ajneu
2016-06-20 13:00   ` ajneu
2016-06-20 13:31     ` Wolfgang Grandegger
2016-06-20 13:53       ` ajneu
2016-06-20 14:28         ` Wolfgang Grandegger
2016-06-21  8:29           ` Stephane Grosjean
2016-06-21  9:58             ` Wolfgang Grandegger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20160620T110554-742@post.gmane.org \
    --to=ajneu1@gmail.com \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox