From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3875 invoked by alias); 5 Nov 2013 15:41:32 -0000 Mailing-List: contact ecos-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-bugs-owner@sourceware.org Received: (qmail 3851 invoked by uid 89); 5 Nov 2013 15:41:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail.ecoscentric.com Received: from Unknown (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 05 Nov 2013 15:41:30 +0000 Received: by mail.ecoscentric.com (Postfix, from userid 48) id DB17D4680006; Tue, 5 Nov 2013 15:41:21 +0000 (GMT) From: bugzilla-daemon@bugs.ecos.sourceware.org To: unassigned@bugs.ecos.sourceware.org Subject: [Bug 1001897] lpc2xxx CAN driver improvements / enhancements Date: Tue, 05 Nov 2013 15:41:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Patches and contributions X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: bernard.fouche@kuantic.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013/txt/msg00635.txt.bz2 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=3D1001897 --- Comment #26 from Bernard Fouch=C3=A9 --- (In reply to comment #13) > > I can't test on the LPC1765 before next week at the earliest and the dr= iver > > I use is different because of the LPC1765 "pending interrupt problem", = but > > what you describe should appear here also if we have the same CAN cell. > >=20 > > Can you describe what you do on the CAN bus to reach bus off? I could t= ry to > > reproduce here and see if I also see RM staying at zero. > >=20 > > Did you check the value of EWL? If is 0 or 255 I wonder what happens... >=20 > Create a thread that prints a debug message in a loop via diag_printf (i.= e. > one message per second). Create a second thread that simply sends CAN > messages (i.e. one message per second). When this application is running, > simply unplug the CAN bus cable from the CAN connector. >=20 > If your debug message from the thread stops, then you know you are spinni= ng > in the CAN ISR. You can activate the debug output in the driver to see > register contents and ISR reason (ICR_BUS_OFF) - it will be printed again > and again ... Sorry, it took me ages to be able to go back to that topic. On the LPC1765, I just did something a bit different than what you wrote, I unplugged the resistor on the CAN wires. Then I got BEI (Bus Error Interrup= t) in CAN1ICR. When I look at the error counter, I have 0x00 (Tx) and 0x87 (Rx) while the warning level is at the default 0x60. Once I reach this point, the ISR is triggered again and again (and I'm not = even in a bus off condition since the test code didn't have time yet to try to s= end a message: it is just floating signals on the wires that shows impossible C= AN frames). Once the wires aren't floating any more, I have no more such interrupts. It seems that the only way to stop having these repeated ISR is to reset the C= AN hardware driver or to disable the interrupt that reacts on a bus error or to have the external condition (in this case bad wiring) to disappear. I did n= ot find in the documentation how to correctly process that case. Then I re-installed the resistor but I had only my test node on the CAN bus. Since no one could acknowledge frames, I had a bus off condition, that work= ed as described: TxREC was at 0x7F , and CAN1MOD changed from 0x0 to 0x01 (res= et mode). Hence in my opinion your patch is not needed on LPC1765 BUT the issue with floating wires needs some attention and the documentation does not describe exactly what's going on anyway whatever the version of this CAN cell. All in all I think it is better to have this kind of processing (taking the decision to reset the CAN controller) to be handled by higher level code instead of having the ISR or DSR to magically do things. I did not encountered problems when I was developing my app since the app powers off the CAN cell as soon as a bus error or bus off condition occurs. This is detected by a CAN event call back function that takes immediate act= ion and also reports this to higher level code. The app re-initialize the CAN a= few seconds later and then tries again to use the CAN bus. So I was immune to t= he repeated ISR illness, whatever the reason. And my high level code is always kept aware about what's going on on the wires. If the CAN hardware driver is reset without having the app to know about it, other weird things may happen, especially if the higher level code assumes than the CAN controller can recover from bus off by itself, or than a previously queued message was correctly sent on the bus, etc. Maybe the feature you added should send a new event reporting that the CAN controller was reset? So high level code knows that it should be reconfigur= ed or messages resent? Anyway I don't use LPC22xx parts so for me this is not a problem! --=20 You are receiving this mail because: You are the assignee for the bug. >>From ecos-bugs-return-10605-listarch-ecos-bugs=sources.redhat.com@sourceware.org Wed Nov 06 09:30:36 2013 Return-Path: Delivered-To: listarch-ecos-bugs@sources.redhat.com Received: (qmail 17137 invoked by alias); 6 Nov 2013 09:30:36 -0000 Mailing-List: contact ecos-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: ecos-bugs-owner@sourceware.org Delivered-To: mailing list ecos-bugs@sourceware.org Received: (qmail 16981 invoked by uid 89); 6 Nov 2013 09:30:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_50,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail.ecoscentric.com Received: from Unknown (HELO mail.ecoscentric.com) (212.13.207.197) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 06 Nov 2013 09:30:34 +0000 Received: by mail.ecoscentric.com (Postfix, from userid 48) id 96467468000D; Wed, 6 Nov 2013 09:30:25 +0000 (GMT) X-Original-To: unassigned@bugs.ecos.sourceware.org Delivered-To: unassigned@bugs.ecos.sourceware.org From: bugzilla-daemon@bugs.ecos.sourceware.org To: unassigned@bugs.ecos.sourceware.org Subject: [Bug 1001897] lpc2xxx CAN driver improvements / enhancements Date: Wed, 06 Nov 2013 09:30:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: eCos X-Bugzilla-Component: Patches and contributions X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: uwe_kindler@web.de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: low X-Bugzilla-Assigned-To: unassigned@bugs.ecos.sourceware.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://bugs.ecos.sourceware.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2013/txt/msg00636.txt.bz2 Content-length: 2363 Please do not reply to this email, use the link below. http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001897 --- Comment #27 from Uwe Kindler --- > Sorry, it took me ages to be able to go back to that topic. Hi Bernard, thank you for taking the time investigating this problem. > On the LPC1765, I just did something a bit different than what you wrote, I > unplugged the resistor on the CAN wires. Then I got BEI (Bus Error > Interrupt) in CAN1ICR. what happpens if you do the same thing that I do - simply disconnect from CAN bus? > All in all I think it is better to have this kind of processing (taking the > decision to reset the CAN controller) to be handled by higher level code > instead of having the ISR or DSR to magically do things. My patch does no do any magically things in ISR and DSR. It does exactly the thing that the hadware manual claims the CAN controller would do. So my implementation does something the CAN controller would do anyway. > I did not encountered problems when I was developing my app since the app > powers off the CAN cell as soon as a bus error or bus off condition occurs. As soon as the bus off condition occurs the application is completely blocked because the ISR fires again and again. So without my patch the application could never react on a bus off condition or power of the CAN cell because the application code has no chance to run. My patch fixes this. > > If the CAN hardware driver is reset without having the app to know about it, > other weird things may happen, especially if the higher level code assumes > than the CAN controller can recover from bus off by itself, or than a > previously queued message was correctly sent on the bus, etc. > > Maybe the feature you added should send a new event reporting that the CAN > controller was reset? So high level code knows that it should be > reconfigured or messages resent? No, I don't agree. With my patch the application gets a bus off event from CAN driver and knows what happened. If a bus off condition occures, each application nows, that it might need to get reconfigured or that messages might got lost or need to get resend. Without my patch the application code is totally blocked and cant't do anything like resetting CAN cell. -- You are receiving this mail because: You are the assignee for the bug.