linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* baudrate detection
@ 2013-12-12 18:40 John Whitmore
  2013-12-14 13:29 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: John Whitmore @ 2013-12-12 18:40 UTC (permalink / raw)
  To: linux-can

Hi linux-can,

I'm coming from the embedded micro controller end of using CAN and have created
my own CAN Network nodes. Now I'm working with a MCP2515 connected to the
Raspberry Pi, so looking at the Linux Kernel.

On my existing nodes the Initialisation of the CAN device the node either knows
the baudrate to setup or it does not. A node that is a fixed node on the
network knows the baudrate of the network, although this can be changed on the
fly. Other devices are not a fixed part of the network and are connected
dynamically to the network for testing or management purposes. These nodes
don't know the baudrate of the network so automatically detect it. When they
detect the baudrate they then connect and inform the higher application code
that the network is connected, so they can proceed.

I was thinking of adding this auto baudrate detection functionality to the
RaspberryPi but being new to Linux development I'm struggling with whether
this functionality should be in Kernel or User Space. I was initially thinking
User Space but given that numerous applications can be using the CAN Network
you really want to centralise this functionality. That possibly means Kernel
Space?

So before I start to do something I thought I'd ask the experts. Does
automatic baudrate detection belong in Kernel Space or out in Userland? Maybe
it's already in the existing Kernel I've just missed it.

JW

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

* Re: baudrate detection
  2013-12-12 18:40 baudrate detection John Whitmore
@ 2013-12-14 13:29 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2013-12-14 13:29 UTC (permalink / raw)
  To: John Whitmore; +Cc: linux-can

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

On 12/12/2013 07:40 PM, John Whitmore wrote:
> I'm coming from the embedded micro controller end of using CAN and have created
> my own CAN Network nodes. Now I'm working with a MCP2515 connected to the
> Raspberry Pi, so looking at the Linux Kernel.

A SPI based CAN adapter like the mcp2515 are known to have bad
performance, you probably will have better CAN experience with an USB
adapter.

> On my existing nodes the Initialisation of the CAN device the node either knows
> the baudrate to setup or it does not. A node that is a fixed node on the
> network knows the baudrate of the network, although this can be changed on the
> fly. Other devices are not a fixed part of the network and are connected
> dynamically to the network for testing or management purposes. These nodes
> don't know the baudrate of the network so automatically detect it. When they
> detect the baudrate they then connect and inform the higher application code
> that the network is connected, so they can proceed.
> 
> I was thinking of adding this auto baudrate detection functionality to the
> RaspberryPi but being new to Linux development I'm struggling with whether
> this functionality should be in Kernel or User Space. I was initially thinking
> User Space but given that numerous applications can be using the CAN Network
> you really want to centralise this functionality. That possibly means Kernel
> Space?
>
> So before I start to do something I thought I'd ask the experts. Does
> automatic baudrate detection belong in Kernel Space or out in Userland? Maybe
> it's already in the existing Kernel I've just missed it.

I think for prototyping the algorithm you should start in userspace, the
you can present it here and then we can discuss if it's better suited in
a library or in the kernel space.

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

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

end of thread, other threads:[~2013-12-14 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-12 18:40 baudrate detection John Whitmore
2013-12-14 13:29 ` Marc Kleine-Budde

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