linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* iMX28 and CAN Error frames
@ 2013-03-15 16:16 Tobias.Grueninger
  2013-03-15 21:23 ` Robert Schwebel
  2013-03-17 19:00 ` Wolfgang Grandegger
  0 siblings, 2 replies; 3+ messages in thread
From: Tobias.Grueninger @ 2013-03-15 16:16 UTC (permalink / raw)
  To: linux-can

Hi,

I have trouble in receiving error frames on my freescale iMX28 board.
Linux mx28 2.6.35.3-g880e772 #35 Mon Jul 30 15:04:31 CEST 2012 armv5tejl GNU/Linux

In normal operation, many telegrams are received and some are sent from the iMX28.

Now I want to implement the error handling. After many trials, I am now out of my wisdom..

The situation is that when I craft manually an error frame and send this on my console to can0
      cansend can0 20000040#

then my application does nicely receive this: (/* are my comments)
************
      virtual void OCanModelPrivate::run(): current telegram: 0X14042240 /* Normal telegram, frame.can_id & CAN_EFF_MASK
      >>>send error frame from other console
      virtual void OCanModelPrivate::run(): current telegram:     0X40 /* the error frame
      CAN_ERR_FLAG raised: CAN_ERR_BUSOFF /*debug output
      run: 20000040 0 - 00 00 00 00 - 00 00 00 00 /*debug output
*************

But, if I e.g. short circuit the CAN Bus to provoke a real Bus Off problem:
***********
	virtual void OCanModelPrivate::run(): current telegram: 0X140222C0
	virtual void OCanModelPrivate::run(): current telegram: 0X80422C0
	>>>CAN short circuit
	/* nothing happens..

	virtual void OCanModelPrivate::run(): no data in the last 5s /* comes from select() timeout
	OCanModelPrivate::run():FD_ISSET == 0 , no data read possible from CAN0: /* comes from "if (FD_ISSET(s, &rdfs)) {..} else{.."
	virtual void OCanModelPrivate::run(): no data in the last 5s
	OCanModelPrivate::run():FD_ISSET == 0 , no data read possible from CAN0: 
	OCanModelPrivate::sendMessage:write: No buffer space available  /* comes from "if ((nbytes = write(s, &frame, sizeof(frame))) != sizeof(frame))"
	OCanModelPrivate::sendMessage:write: No buffer space available
	virtual void OCanModelPrivate::run(): no data in the last 5s
	OCanModelPrivate::run():FD_ISSET == 0 , no data read possible from CAN0: Success
	OCanModelPrivate::sendMessage:write: No buffer space available
      OCanModelPrivate::sendMessage:write: No buffer space available
**************

The Error mask is this:
	can_err_mask_t err_mask = CAN_ERR_MASK;
	if ( setsockopt(d->s, SOL_CAN_RAW, CAN_RAW_ERR_FILTER, &err_mask, sizeof(err_mask)) ) {.}

Where can be searched, or what did I not understood?


Best Regards / Mit freundlichen Grüßen / Cordialement

Tobias Grüninger 
Emerson Network Power GmbH | Niederlassung Erlangen, Schallershofer Str. 141  | 91056 Erlangen


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-03-17 19:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-15 16:16 iMX28 and CAN Error frames Tobias.Grueninger
2013-03-15 21:23 ` Robert Schwebel
2013-03-17 19:00 ` Wolfgang Grandegger

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).