All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Mylene Josserand <Mylene.Josserand@navocap.com>
Cc: linux-can@vger.kernel.org
Subject: Re: [imx27 - mcp251x] MCP251x does not work in static ?
Date: Thu, 11 Apr 2013 17:09:37 +0200	[thread overview]
Message-ID: <5166D231.2040107@pengutronix.de> (raw)
In-Reply-To: <CA78C307B8F06747967D122FC656B153774467@SERVEUR0.nvp.local>

[-- Attachment #1: Type: text/plain, Size: 3161 bytes --]

On 04/11/2013 04:39 PM, Mylene Josserand wrote:
>> Err... don't set IP addresses on CAN interfaces, that's wrong.
> Yes, I even do not know why I set the IP address !

might be the usual habit of giving network interfaces IP addresses  :)

[...]

> Bad news for me.
> 
> I think that your patch works but I have the same error as my first post 
> : the CAN / spi is blocked after some frames sent/received.
> 
> Currently, I use a CAN232 and a small program which send CAN frames 
> through the 232 to the CAN. Then, In the same time, I read the CAN 
> frames sent with "candump can0".
> 
> I received the good message sent (00 01 02 03 04) :
> 
> "
> root@navocap:~# candump can0
> interface = can0, family = 29, type = 3, proto = 1
> <0x001> [5] 00 01 02 03 04
> <0x001> [5] 00 01 02 03 04
> <0x001> [5] 00 01 02 03 04
> <0x001> [5] 00 01 02 03 04
> <0x001> [5] 00 01 02 03 04
> <0x001> [5] 00 01 02 03 04
> <0x001> [5] 00 01 02 03 04
> <0x001> [5] 00 01 02 03 04
> <0x001> [5] 00 01 02 03 04
> <0x001> [5] 00 01 02 03 04
> [...]
> "
> 
> I have read 15 383 frames but after 15 834, it hangs. And after that, I 
> can not act on the CAN anymore. A "ifconfig can0 down" hangs the kernel 
> (even with ^C) and I have to restart the board to use the CAN again !

Ohhh, not good.

Activate "MAGIC_SYSRQ" in the kernel via "make menuconfog" (Kernel
hacking -> Magic SysRq key) and bring your system to hang again. Then
connect via serial line to your embedded system and send a "break". (See
documentation of your terminal program.). After the "break" send a
normal "?" to get the help. If I remember correctly, use "break" +  "d"
to create a stackdump (see
http://lxr.linux.no/linux+v3.8.6/Documentation/sysrq.txt for more
documentation). You might want to try the magic sys request if your
system is still alive to test if your setup is working.

With the stack trace you might figure out what the system is doing.

> I really think that it is not linked to your patch (do you want me to 
> send the "Tested by" anyway ?) but to my first problem. The kernel 
> update did not seem to fix that.
> Could you help me to try to fix it ? Because I really do not know how to 
> debug / fix it.
> For CAN bus, which is the most CAN chip used ? Do you think that the 
> MCP2515 is a good choice ?

No, mcp2515 is the second worst choice if CAN chips I know, just the
mcp2510 is worse. If you can change your processor switch to a imx25 or
imx35, they have a CAN controller built-in. If you can redesign your
hardware, you can add a sja1000 to the external memory interface of the
imx27. But you need 3.3V -> 5V level shifters, as AFAIK the sja1000 is
only available with 5V io voltage. The easiest option is to add an USB
based CAN adapter to your system. Have a look at the kernel which USB
adapters are supported.

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: 263 bytes --]

  reply	other threads:[~2013-04-11 15:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-10 13:07 [imx27 - mcp251x] MCP251x does not work in static ? Mylene Josserand
2013-04-10 13:39 ` Marc Kleine-Budde
2013-04-10 14:11   ` Mylene Josserand
2013-04-10 15:30     ` Marc Kleine-Budde
2013-04-11  7:39       ` Mylene Josserand
2013-04-11  7:49         ` Marc Kleine-Budde
2013-04-11  8:04           ` Mylene Josserand
2013-04-11  8:39             ` Marc Kleine-Budde
2013-04-11  9:22               ` Mylene Josserand
2013-04-11  9:49                 ` Marc Kleine-Budde
2013-04-11 14:39                   ` Mylene Josserand
2013-04-11 15:09                     ` Marc Kleine-Budde [this message]
2013-04-12  9:24                       ` Mylene Josserand
2013-04-12  9:49                         ` Marc Kleine-Budde
2013-04-12  9:36                     ` Marc Kleine-Budde
2013-04-12  9:40                       ` Mylene Josserand
2013-04-12  9:48                         ` Marc Kleine-Budde
2013-04-11  8:36           ` RFC: [PATCH] can: mcp251x: add missing IRQF_ONESHOT to request_threaded_irq Marc Kleine-Budde
2013-04-12 11:16             ` Marc Kleine-Budde

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=5166D231.2040107@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=Mylene.Josserand@navocap.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.