Linux CAN drivers development
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Rein Appeldoorn <reinappeldoorn@gmail.com>, linux-can@vger.kernel.org
Subject: Re: SocketCAN support for a Serial-CAN controller
Date: Sat, 23 Apr 2016 15:54:37 +0200	[thread overview]
Message-ID: <571B7E9D.7090308@hartkopp.net> (raw)
In-Reply-To: <CAPO0vcvCBixyQn76ywVQ6GbNbHmB7sH7FqYB9t33qL72pdQDcw@mail.gmail.com>

Hello Rein,

On 04/22/2016 01:17 PM, Rein Appeldoorn wrote:

> Up until now, I've been working with SocketCAN via CANUSB adapters
> from Lawycel (http://www.can232.com/?page_id=16). However, now we
> received a new platform with another serial-can controller from
> axiomtek (http://www.axiomtek.com/Default.aspx?MenuId=Products&FunctionId=ProductView&ItemId=8270).
>
> I am able to communicate with the CAN controller via serial and
> receive CAN frames. However, using slcand to create a socketcan
> interface does not work. As I see here
> https://github.com/linux-can/can-utils/blob/master/slcand.c , the
> slcand program sends specific commands to the serial bus and then
> creates a bridge between the socket and serial. However, the commands
> are different for my CAN controller.

Yes. That's pretty bad to reinvent the wheel by creating 'just another' 
CAN ASCII protocol :-(

> Can somebody give me some pointers how to get SocketCAN to work with
> an arbitrary serial-can controller?

The slcan driver supports the standard SLCAN protocols as you know from 
Lawicel:

https://github.com/linux-can/can-misc/blob/master/docs/SLCAN-API.pdf

> I'm am very new to these low level Linux things so I really would
> appreciate your help / corrections. Thanks in advance,

You would need to extend the slcan.c driver and the slcan tools from the 
can-utils to cope with the Axiomtek protocol.

Alternatively you can write a user space application that talks to the 
Axiomtek device and send the CAN frames to a virtual CAN (e.g. vcan0) so 
that you can use the can-utils on top of that virtual CAN.

Just a different idea: As you obviously have a full-size mini 
PCI-Express module - why don't you use a proper CAN PCIe interface with 
a PCI-connected SJA1000 controller which is already supported by Linux?

All this serial line encapsulation stuff does not support the really 
good (configuration) things and error handling from SocketCAN.

Regards,
Oliver

ps. Maybe Axiomtek can also provide a SLCAN compatible firmware ...

  reply	other threads:[~2016-04-23 13:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAPO0vcvuOaGxcCA-722c60o4-k-6somqCD1nuaaV6tWiPkoiTw@mail.gmail.com>
2016-04-22 11:17 ` SocketCAN support for a Serial-CAN controller Rein Appeldoorn
2016-04-23 13:54   ` Oliver Hartkopp [this message]
2016-04-25  7:26     ` Rein Appeldoorn
2016-04-25  7:42       ` Oliver Hartkopp
2016-04-25  7:43         ` Rein Appeldoorn

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=571B7E9D.7090308@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=linux-can@vger.kernel.org \
    --cc=reinappeldoorn@gmail.com \
    /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