This is the mail archive of the ecos-bugs@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug 1001440] New: can_lpc2xxx.c: driver confuses 'bus error' and'bus off' conditions


Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001440

           Summary: can_lpc2xxx.c: driver confuses 'bus error' and 'bus
                    off' conditions
           Product: eCos
           Version: CVS
          Platform: Other (please specify)
        OS/Version: Cortex-M
            Status: UNCONFIRMED
          Severity: normal
          Priority: low
         Component: CAN
        AssignedTo: unassigned@bugs.ecos.sourceware.org
        ReportedBy: bernard.fouche@kuantic.com
                CC: ecos-bugs@ecos.sourceware.org
             Class: Advice Request


In function lpc2xxx_can_get_even():

        //
        // 1: Bus Error Interrupt -- this bit is set if the BEIE bit in CANIE
is 1, and the CAN
        // controller detects an error on the bus.
        //
        if (event & ICR_BUS_ERR)
        {
            pevent->flags |= CYGNUM_CAN_EVENT_BUS_OFF;
            LPC2XXX_DBG_PRINT("ICR_BUS_ERR (%p)\n", (void*) chan);
        }

The comment is okay but the resulting code is incorrect: 'bus off' means the
controller is disconnected from the bus because it had many problems sending
data. The LPC2XXX/17XX controller reports 'bus off' condition in bit 'BS' of
register CANxGSR: the tested bit comes from CANxICR and just signals an error
on the bus, not that the controller is disconnected.

This function should raise CYGNUM_CAN_EVENT_PHY_FAULT and supplementary
processing is needed for 'bus off'.

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]