All of lore.kernel.org
 help / color / mirror / Atom feed
* Linux board with 10 CANs
@ 2015-05-15  7:56 François Beaulier
  2015-05-15  8:20 ` Yegor Yefremov
                   ` (2 more replies)
  0 siblings, 3 replies; 24+ messages in thread
From: François Beaulier @ 2015-05-15  7:56 UTC (permalink / raw)
  To: linux-can

Hi,

I'm starting the design of a CPU board, based on a computer on module 
with a very common SOC like i.mx6 or am335x.
I need to fit my board with at least 10 CAN ports, may be more. (The SOC 
have 2 CANs so i need 8 more)
The board will run with Linux and of course i want a socketcan interface 
for each bus !
CAN bitrate needed is quite low (50kbps) and latency is not critical but 
bus load may reach 100% sometimes.
As far as possible i want to avoid driver development, or just doing 
slight modifications on an existing driver.
I don't want to use MCP2515, i had trouble with it on a previous design 
because of the lack of buffer in the chip.
I can't imagine putting 8 MCP2515 and not missing any frame, but may be 
i'm wrong ?

Here are the options i have considered, they involve using external MCUs 
to provide enough CAN interfaces :

- MCUs with SLCAN : SLCAN have the advantage of simplicity and it should 
offer enough performance at low data rate. Problem is that it would 
require 8 UARTS. I could modify SLCAN driver to allow multiple CAN 
channels on the same UART, and so use MCUs with multiple CANs, does it 
sounds reasonable ?

- MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI 
protocol manageable on the MCU side (SPI slave). The MCU will be able to 
provide the buffer for CAN frames that the MCP does not have. This 
option is just a way of trying to go fast, it is not very elegant, and 
have the limitation of one CAN channel per SPI connection / driver instance.

- MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this 
list. This is probably the best choice for a long term and more generic 
solution. But i'm afraid it may require too much work to complete. What 
is the status of this driver right now ? Does anyone have an idea of the 
remaining work to do to make it ready for mainline ? Stefano are you 
available to spend more time on it ? I'm also wondering whether multiple 
instances of the driver can run concurently if i put more than one MCU ?

Concerning the MCU software i could release it as an open-source 
project, anyone interested in participating ?
I'm very familiar with STM32 MCUs so i will probably use an STM32F072 
(low cost cortex M0 with one CAN).

Any idea or advice is welcome, thank you for reading this much too long 
post.

Regards

Francois Beaulier
www.ingelibre.fr

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

* Re: Linux board with 10 CANs
  2015-05-15  7:56 Linux board with 10 CANs François Beaulier
@ 2015-05-15  8:20 ` Yegor Yefremov
  2015-05-15  8:50   ` François Beaulier
  2015-05-15  9:11   ` Marc Kleine-Budde
  2015-05-15 13:54 ` Bernd Krumboeck
  2015-05-15 15:24 ` Tom Evans
  2 siblings, 2 replies; 24+ messages in thread
From: Yegor Yefremov @ 2015-05-15  8:20 UTC (permalink / raw)
  To: François Beaulier; +Cc: linux-can

On Fri, May 15, 2015 at 9:56 AM, François Beaulier <fbeaulier@orange.fr> wrote:
> Hi,
>
> I'm starting the design of a CPU board, based on a computer on module with a
> very common SOC like i.mx6 or am335x.
> I need to fit my board with at least 10 CAN ports, may be more. (The SOC
> have 2 CANs so i need 8 more)
> The board will run with Linux and of course i want a socketcan interface for
> each bus !
> CAN bitrate needed is quite low (50kbps) and latency is not critical but bus
> load may reach 100% sometimes.
> As far as possible i want to avoid driver development, or just doing slight
> modifications on an existing driver.
> I don't want to use MCP2515, i had trouble with it on a previous design
> because of the lack of buffer in the chip.
> I can't imagine putting 8 MCP2515 and not missing any frame, but may be i'm
> wrong ?
>
> Here are the options i have considered, they involve using external MCUs to
> provide enough CAN interfaces :
>
> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it should
> offer enough performance at low data rate. Problem is that it would require
> 8 UARTS. I could modify SLCAN driver to allow multiple CAN channels on the
> same UART, and so use MCUs with multiple CANs, does it sounds reasonable ?
>
> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI protocol
> manageable on the MCU side (SPI slave). The MCU will be able to provide the
> buffer for CAN frames that the MCP does not have. This option is just a way
> of trying to go fast, it is not very elegant, and have the limitation of one
> CAN channel per SPI connection / driver instance.
>
> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this list.
> This is probably the best choice for a long term and more generic solution.
> But i'm afraid it may require too much work to complete. What is the status
> of this driver right now ? Does anyone have an idea of the remaining work to
> do to make it ready for mainline ? Stefano are you available to spend more
> time on it ? I'm also wondering whether multiple instances of the driver can
> run concurently if i put more than one MCU ?
>
> Concerning the MCU software i could release it as an open-source project,
> anyone interested in participating ?
> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 (low
> cost cortex M0 with one CAN).
>
> Any idea or advice is welcome, thank you for reading this much too long
> post.

Is it possible to attach 8 SJA1000s over local bus? The driver is
already in mainline kernel.

Yegor

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

* Re: Linux board with 10 CANs
  2015-05-15  8:20 ` Yegor Yefremov
@ 2015-05-15  8:50   ` François Beaulier
  2015-05-15  9:11   ` Marc Kleine-Budde
  1 sibling, 0 replies; 24+ messages in thread
From: François Beaulier @ 2015-05-15  8:50 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: linux-can

Le 15/05/2015 10:20, Yegor Yefremov a écrit :
> On Fri, May 15, 2015 at 9:56 AM, François Beaulier <fbeaulier@orange.fr> wrote:
>> Hi,
>>
>> I'm starting the design of a CPU board, based on a computer on module with a
>> very common SOC like i.mx6 or am335x.
>> I need to fit my board with at least 10 CAN ports, may be more. (The SOC
>> have 2 CANs so i need 8 more)
>> The board will run with Linux and of course i want a socketcan interface for
>> each bus !
>> CAN bitrate needed is quite low (50kbps) and latency is not critical but bus
>> load may reach 100% sometimes.
>> As far as possible i want to avoid driver development, or just doing slight
>> modifications on an existing driver.
>> I don't want to use MCP2515, i had trouble with it on a previous design
>> because of the lack of buffer in the chip.
>> I can't imagine putting 8 MCP2515 and not missing any frame, but may be i'm
>> wrong ?
>>
>> Here are the options i have considered, they involve using external MCUs to
>> provide enough CAN interfaces :
>>
>> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it should
>> offer enough performance at low data rate. Problem is that it would require
>> 8 UARTS. I could modify SLCAN driver to allow multiple CAN channels on the
>> same UART, and so use MCUs with multiple CANs, does it sounds reasonable ?
>>
>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI protocol
>> manageable on the MCU side (SPI slave). The MCU will be able to provide the
>> buffer for CAN frames that the MCP does not have. This option is just a way
>> of trying to go fast, it is not very elegant, and have the limitation of one
>> CAN channel per SPI connection / driver instance.
>>
>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this list.
>> This is probably the best choice for a long term and more generic solution.
>> But i'm afraid it may require too much work to complete. What is the status
>> of this driver right now ? Does anyone have an idea of the remaining work to
>> do to make it ready for mainline ? Stefano are you available to spend more
>> time on it ? I'm also wondering whether multiple instances of the driver can
>> run concurently if i put more than one MCU ?
>>
>> Concerning the MCU software i could release it as an open-source project,
>> anyone interested in participating ?
>> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 (low
>> cost cortex M0 with one CAN).
>>
>> Any idea or advice is welcome, thank you for reading this much too long
>> post.
> Is it possible to attach 8 SJA1000s over local bus? The driver is
> already in mainline kernel.
>
> Yegor
The am335x have a GPMC (General Purpose Memory Controller), i suppose i 
should be able to use it to connect SJA1000s but GPMC settings needs to 
be added to the driver somewhere.
I will search about how the GPMC is supported in the Linux kernel.
Nice idea, thanks Yegor

Francois

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

* Re: Linux board with 10 CANs
  2015-05-15  8:20 ` Yegor Yefremov
  2015-05-15  8:50   ` François Beaulier
@ 2015-05-15  9:11   ` Marc Kleine-Budde
  2015-05-15  9:33     ` François Beaulier
  1 sibling, 1 reply; 24+ messages in thread
From: Marc Kleine-Budde @ 2015-05-15  9:11 UTC (permalink / raw)
  To: Yegor Yefremov, François Beaulier; +Cc: linux-can

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

On 05/15/2015 10:20 AM, Yegor Yefremov wrote:
> On Fri, May 15, 2015 at 9:56 AM, François Beaulier <fbeaulier@orange.fr> wrote:
>> Hi,
>>
>> I'm starting the design of a CPU board, based on a computer on module with a
>> very common SOC like i.mx6 or am335x.
>> I need to fit my board with at least 10 CAN ports, may be more. (The SOC
>> have 2 CANs so i need 8 more)
>> The board will run with Linux and of course i want a socketcan interface for
>> each bus !
>> CAN bitrate needed is quite low (50kbps) and latency is not critical but bus
>> load may reach 100% sometimes.
>> As far as possible i want to avoid driver development, or just doing slight
>> modifications on an existing driver.
>> I don't want to use MCP2515, i had trouble with it on a previous design
>> because of the lack of buffer in the chip.
>> I can't imagine putting 8 MCP2515 and not missing any frame, but may be i'm
>> wrong ?
>>
>> Here are the options i have considered, they involve using external MCUs to
>> provide enough CAN interfaces :
>>
>> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it should
>> offer enough performance at low data rate. Problem is that it would require
>> 8 UARTS. I could modify SLCAN driver to allow multiple CAN channels on the
>> same UART, and so use MCUs with multiple CANs, does it sounds reasonable ?
>>
>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI protocol
>> manageable on the MCU side (SPI slave). The MCU will be able to provide the
>> buffer for CAN frames that the MCP does not have. This option is just a way
>> of trying to go fast, it is not very elegant, and have the limitation of one
>> CAN channel per SPI connection / driver instance.
>>
>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this list.
>> This is probably the best choice for a long term and more generic solution.
>> But i'm afraid it may require too much work to complete. What is the status
>> of this driver right now ? Does anyone have an idea of the remaining work to
>> do to make it ready for mainline ? Stefano are you available to spend more
>> time on it ? I'm also wondering whether multiple instances of the driver can
>> run concurently if i put more than one MCU ?
>>
>> Concerning the MCU software i could release it as an open-source project,
>> anyone interested in participating ?
>> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 (low
>> cost cortex M0 with one CAN).
>>
>> Any idea or advice is welcome, thank you for reading this much too long
>> post.
> 
> Is it possible to attach 8 SJA1000s over local bus? The driver is
> already in mainline kernel.

Don't use the mcp251x.

If you have PCIe, there are some dual CAN modules (available in miniPIC,
too). But PCIe ist probably quite cost intensive. USB would be an
option, but I'm not sure if there are modules that can be
connected/soldered to a PCB. As Yegor said, SJA1000s + a CPLD are an
option, too, but IIRC the SJA1000 has a 5V IO interface.

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

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

* Re: Linux board with 10 CANs
  2015-05-15  9:11   ` Marc Kleine-Budde
@ 2015-05-15  9:33     ` François Beaulier
  2015-05-15 10:24       ` Andri Yngvason
  2015-05-15 12:38       ` Gerhard Uttenthaler
  0 siblings, 2 replies; 24+ messages in thread
From: François Beaulier @ 2015-05-15  9:33 UTC (permalink / raw)
  To: Marc Kleine-Budde, Yegor Yefremov; +Cc: linux-can

Le 15/05/2015 11:11, Marc Kleine-Budde a écrit :
> On 05/15/2015 10:20 AM, Yegor Yefremov wrote:
>> On Fri, May 15, 2015 at 9:56 AM, François Beaulier <fbeaulier@orange.fr> wrote:
>>> Hi,
>>>
>>> I'm starting the design of a CPU board, based on a computer on module with a
>>> very common SOC like i.mx6 or am335x.
>>> I need to fit my board with at least 10 CAN ports, may be more. (The SOC
>>> have 2 CANs so i need 8 more)
>>> The board will run with Linux and of course i want a socketcan interface for
>>> each bus !
>>> CAN bitrate needed is quite low (50kbps) and latency is not critical but bus
>>> load may reach 100% sometimes.
>>> As far as possible i want to avoid driver development, or just doing slight
>>> modifications on an existing driver.
>>> I don't want to use MCP2515, i had trouble with it on a previous design
>>> because of the lack of buffer in the chip.
>>> I can't imagine putting 8 MCP2515 and not missing any frame, but may be i'm
>>> wrong ?
>>>
>>> Here are the options i have considered, they involve using external MCUs to
>>> provide enough CAN interfaces :
>>>
>>> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it should
>>> offer enough performance at low data rate. Problem is that it would require
>>> 8 UARTS. I could modify SLCAN driver to allow multiple CAN channels on the
>>> same UART, and so use MCUs with multiple CANs, does it sounds reasonable ?
>>>
>>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI protocol
>>> manageable on the MCU side (SPI slave). The MCU will be able to provide the
>>> buffer for CAN frames that the MCP does not have. This option is just a way
>>> of trying to go fast, it is not very elegant, and have the limitation of one
>>> CAN channel per SPI connection / driver instance.
>>>
>>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this list.
>>> This is probably the best choice for a long term and more generic solution.
>>> But i'm afraid it may require too much work to complete. What is the status
>>> of this driver right now ? Does anyone have an idea of the remaining work to
>>> do to make it ready for mainline ? Stefano are you available to spend more
>>> time on it ? I'm also wondering whether multiple instances of the driver can
>>> run concurently if i put more than one MCU ?
>>>
>>> Concerning the MCU software i could release it as an open-source project,
>>> anyone interested in participating ?
>>> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 (low
>>> cost cortex M0 with one CAN).
>>>
>>> Any idea or advice is welcome, thank you for reading this much too long
>>> post.
>> Is it possible to attach 8 SJA1000s over local bus? The driver is
>> already in mainline kernel.
> Don't use the mcp251x.
>
> If you have PCIe, there are some dual CAN modules (available in miniPIC,
> too). But PCIe ist probably quite cost intensive. USB would be an
> option, but I'm not sure if there are modules that can be
> connected/soldered to a PCB. As Yegor said, SJA1000s + a CPLD are an
> option, too, but IIRC the SJA1000 has a 5V IO interface.
>
> Marc
>
Module based solutions are too expensive, whether it is PCIe or USB.
There are some bridge chips PCIe <-> memory, but i'm not familiar with that.
And you are right the SJA1000 is an old 5V beast !

Francois

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

* Re: Linux board with 10 CANs
  2015-05-15  9:33     ` François Beaulier
@ 2015-05-15 10:24       ` Andri Yngvason
  2015-05-15 12:40         ` François Beaulier
  2015-05-15 12:38       ` Gerhard Uttenthaler
  1 sibling, 1 reply; 24+ messages in thread
From: Andri Yngvason @ 2015-05-15 10:24 UTC (permalink / raw)
  To: François Beaulier, Marc Kleine-Budde, Yegor Yefremov; +Cc: linux-can

Quoting François Beaulier (2015-05-15 09:33:30)
> Le 15/05/2015 11:11, Marc Kleine-Budde a écrit :
> > On 05/15/2015 10:20 AM, Yegor Yefremov wrote:
> >> On Fri, May 15, 2015 at 9:56 AM, François Beaulier <fbeaulier@orange.fr> wrote:
> >>> Hi,
> >>>
> >>> I'm starting the design of a CPU board, based on a computer on module with a
> >>> very common SOC like i.mx6 or am335x.
> >>> I need to fit my board with at least 10 CAN ports, may be more. (The SOC
> >>> have 2 CANs so i need 8 more)
> >>> The board will run with Linux and of course i want a socketcan interface for
> >>> each bus !
> >>> CAN bitrate needed is quite low (50kbps) and latency is not critical but bus
> >>> load may reach 100% sometimes.
> >>> As far as possible i want to avoid driver development, or just doing slight
> >>> modifications on an existing driver.
> >>> I don't want to use MCP2515, i had trouble with it on a previous design
> >>> because of the lack of buffer in the chip.
> >>> I can't imagine putting 8 MCP2515 and not missing any frame, but may be i'm
> >>> wrong ?
> >>>
> >>> Here are the options i have considered, they involve using external MCUs to
> >>> provide enough CAN interfaces :
> >>>
> >>> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it should
> >>> offer enough performance at low data rate. Problem is that it would require
> >>> 8 UARTS. I could modify SLCAN driver to allow multiple CAN channels on the
> >>> same UART, and so use MCUs with multiple CANs, does it sounds reasonable ?
> >>>
> >>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI protocol
> >>> manageable on the MCU side (SPI slave). The MCU will be able to provide the
> >>> buffer for CAN frames that the MCP does not have. This option is just a way
> >>> of trying to go fast, it is not very elegant, and have the limitation of one
> >>> CAN channel per SPI connection / driver instance.
> >>>
> >>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this list.
> >>> This is probably the best choice for a long term and more generic solution.
> >>> But i'm afraid it may require too much work to complete. What is the status
> >>> of this driver right now ? Does anyone have an idea of the remaining work to
> >>> do to make it ready for mainline ? Stefano are you available to spend more
> >>> time on it ? I'm also wondering whether multiple instances of the driver can
> >>> run concurently if i put more than one MCU ?
> >>>
> >>> Concerning the MCU software i could release it as an open-source project,
> >>> anyone interested in participating ?
> >>> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 (low
> >>> cost cortex M0 with one CAN).
> >>>
> >>> Any idea or advice is welcome, thank you for reading this much too long
> >>> post.
> >> Is it possible to attach 8 SJA1000s over local bus? The driver is
> >> already in mainline kernel.
> > Don't use the mcp251x.
> >
> > If you have PCIe, there are some dual CAN modules (available in miniPIC,
> > too). But PCIe ist probably quite cost intensive. USB would be an
> > option, but I'm not sure if there are modules that can be
> > connected/soldered to a PCB. As Yegor said, SJA1000s + a CPLD are an
> > option, too, but IIRC the SJA1000 has a 5V IO interface.
> >
> > Marc
> >
> Module based solutions are too expensive, whether it is PCIe or USB.
> There are some bridge chips PCIe <-> memory, but i'm not familiar with that.
> And you are right the SJA1000 is an old 5V beast !
> 
> Francois

Have you considered FPGA?

Andri

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

* Re: Linux board with 10 CANs
  2015-05-15  9:33     ` François Beaulier
  2015-05-15 10:24       ` Andri Yngvason
@ 2015-05-15 12:38       ` Gerhard Uttenthaler
  2015-05-15 12:48         ` Marc Kleine-Budde
  1 sibling, 1 reply; 24+ messages in thread
From: Gerhard Uttenthaler @ 2015-05-15 12:38 UTC (permalink / raw)
  To: François Beaulier, Marc Kleine-Budde, Yegor Yefremov; +Cc: linux-can



Am 15.05.2015 um 11:33 schrieb François Beaulier:
> Le 15/05/2015 11:11, Marc Kleine-Budde a écrit :
>> On 05/15/2015 10:20 AM, Yegor Yefremov wrote:
>>> On Fri, May 15, 2015 at 9:56 AM, François Beaulier 
>>> <fbeaulier@orange.fr> wrote:
>>>> Hi,
>>>> 
>>>> I'm starting the design of a CPU board, based on a computer
>>>> on module with a very common SOC like i.mx6 or am335x. I need
>>>> to fit my board with at least 10 CAN ports, may be more.
>>>> (The SOC have 2 CANs so i need 8 more) The board will run
>>>> with Linux and of course i want a socketcan interface for 
>>>> each bus ! CAN bitrate needed is quite low (50kbps) and
>>>> latency is not critical but bus load may reach 100%
>>>> sometimes. As far as possible i want to avoid driver
>>>> development, or just doing slight modifications on an
>>>> existing driver. I don't want to use MCP2515, i had trouble
>>>> with it on a previous design because of the lack of buffer in
>>>> the chip. I can't imagine putting 8 MCP2515 and not missing
>>>> any frame, but may be i'm wrong ?
>>>> 
>>>> Here are the options i have considered, they involve using
>>>> external MCUs to provide enough CAN interfaces :
>>>> 
>>>> - MCUs with SLCAN : SLCAN have the advantage of simplicity
>>>> and it should offer enough performance at low data rate.
>>>> Problem is that it would require 8 UARTS. I could modify
>>>> SLCAN driver to allow multiple CAN channels on the same UART,
>>>> and so use MCUs with multiple CANs, does it sounds reasonable
>>>> ?
>>>> 
>>>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the
>>>> SPI protocol manageable on the MCU side (SPI slave). The MCU
>>>> will be able to provide the buffer for CAN frames that the
>>>> MCP does not have. This option is just a way of trying to go
>>>> fast, it is not very elegant, and have the limitation of one 
>>>> CAN channel per SPI connection / driver instance.
>>>> 
>>>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted
>>>> on this list. This is probably the best choice for a long
>>>> term and more generic solution. But i'm afraid it may require
>>>> too much work to complete. What is the status of this driver
>>>> right now ? Does anyone have an idea of the remaining work
>>>> to do to make it ready for mainline ? Stefano are you
>>>> available to spend more time on it ? I'm also wondering
>>>> whether multiple instances of the driver can run concurently
>>>> if i put more than one MCU ?
>>>> 
>>>> Concerning the MCU software i could release it as an
>>>> open-source project, anyone interested in participating ? I'm
>>>> very familiar with STM32 MCUs so i will probably use an 
>>>> STM32F072 (low cost cortex M0 with one CAN).
>>>> 
>>>> Any idea or advice is welcome, thank you for reading this
>>>> much too long post.
>>> Is it possible to attach 8 SJA1000s over local bus? The driver
>>> is already in mainline kernel.
>> Don't use the mcp251x.
>> 
>> If you have PCIe, there are some dual CAN modules (available in
>> miniPIC, too). But PCIe ist probably quite cost intensive. USB
>> would be an option, but I'm not sure if there are modules that
>> can be connected/soldered to a PCB. As Yegor said, SJA1000s + a
>> CPLD are an option, too, but IIRC the SJA1000 has a 5V IO
>> interface.
>> 
>> Marc
>> 
> Module based solutions are too expensive, whether it is PCIe or
> USB. There are some bridge chips PCIe <-> memory, but i'm not
> familiar with that. And you are right the SJA1000 is an old 5V
> beast !
> 

Also a point to consider is that the speed you can read a SJA1000 chip
is based on the clock frequency of this chip. And you have to
read/write byte by byte. This may be too slow for 10 channels.

Regards
Gerhard

-- 
EMS Dr. Thomas Wuensche e.K.
Sonnenhang 3
85304 Ilmmuenster
HRA Neuburg a.d. Donau, HR-Nr. 70.106

Phone: +49-8441-490260
Fax  : +49-8441-81860
http://www.ems-wuensche.com

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

* Re: Linux board with 10 CANs
  2015-05-15 10:24       ` Andri Yngvason
@ 2015-05-15 12:40         ` François Beaulier
  2015-05-15 12:47           ` Marc Kleine-Budde
  0 siblings, 1 reply; 24+ messages in thread
From: François Beaulier @ 2015-05-15 12:40 UTC (permalink / raw)
  To: Andri Yngvason, Marc Kleine-Budde, Yegor Yefremov; +Cc: linux-can

Le 15/05/2015 12:24, Andri Yngvason a écrit :
> Quoting François Beaulier (2015-05-15 09:33:30)
>> Le 15/05/2015 11:11, Marc Kleine-Budde a écrit :
>>> On 05/15/2015 10:20 AM, Yegor Yefremov wrote:
>>>> On Fri, May 15, 2015 at 9:56 AM, François Beaulier <fbeaulier@orange.fr> wrote:
>>>>> Hi,
>>>>>
>>>>> I'm starting the design of a CPU board, based on a computer on module with a
>>>>> very common SOC like i.mx6 or am335x.
>>>>> I need to fit my board with at least 10 CAN ports, may be more. (The SOC
>>>>> have 2 CANs so i need 8 more)
>>>>> The board will run with Linux and of course i want a socketcan interface for
>>>>> each bus !
>>>>> CAN bitrate needed is quite low (50kbps) and latency is not critical but bus
>>>>> load may reach 100% sometimes.
>>>>> As far as possible i want to avoid driver development, or just doing slight
>>>>> modifications on an existing driver.
>>>>> I don't want to use MCP2515, i had trouble with it on a previous design
>>>>> because of the lack of buffer in the chip.
>>>>> I can't imagine putting 8 MCP2515 and not missing any frame, but may be i'm
>>>>> wrong ?
>>>>>
>>>>> Here are the options i have considered, they involve using external MCUs to
>>>>> provide enough CAN interfaces :
>>>>>
>>>>> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it should
>>>>> offer enough performance at low data rate. Problem is that it would require
>>>>> 8 UARTS. I could modify SLCAN driver to allow multiple CAN channels on the
>>>>> same UART, and so use MCUs with multiple CANs, does it sounds reasonable ?
>>>>>
>>>>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI protocol
>>>>> manageable on the MCU side (SPI slave). The MCU will be able to provide the
>>>>> buffer for CAN frames that the MCP does not have. This option is just a way
>>>>> of trying to go fast, it is not very elegant, and have the limitation of one
>>>>> CAN channel per SPI connection / driver instance.
>>>>>
>>>>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this list.
>>>>> This is probably the best choice for a long term and more generic solution.
>>>>> But i'm afraid it may require too much work to complete. What is the status
>>>>> of this driver right now ? Does anyone have an idea of the remaining work to
>>>>> do to make it ready for mainline ? Stefano are you available to spend more
>>>>> time on it ? I'm also wondering whether multiple instances of the driver can
>>>>> run concurently if i put more than one MCU ?
>>>>>
>>>>> Concerning the MCU software i could release it as an open-source project,
>>>>> anyone interested in participating ?
>>>>> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 (low
>>>>> cost cortex M0 with one CAN).
>>>>>
>>>>> Any idea or advice is welcome, thank you for reading this much too long
>>>>> post.
>>>> Is it possible to attach 8 SJA1000s over local bus? The driver is
>>>> already in mainline kernel.
>>> Don't use the mcp251x.
>>>
>>> If you have PCIe, there are some dual CAN modules (available in miniPIC,
>>> too). But PCIe ist probably quite cost intensive. USB would be an
>>> option, but I'm not sure if there are modules that can be
>>> connected/soldered to a PCB. As Yegor said, SJA1000s + a CPLD are an
>>> option, too, but IIRC the SJA1000 has a 5V IO interface.
>>>
>>> Marc
>>>
>> Module based solutions are too expensive, whether it is PCIe or USB.
>> There are some bridge chips PCIe <-> memory, but i'm not familiar with that.
>> And you are right the SJA1000 is an old 5V beast !
>>
>> Francois
> Have you considered FPGA?
>
> Andri
I don't know much about FPGA, i can see in the kernel that there are 
c_can and m_can drivers, i guess i have to add something like a PCIe 
bridge to connect the CAN controllers with the SOC ?
Is there a way to use FPGA that would not lead to driver development ?
Do you have any link where i can learn more about Linux + FPGA + CAN ?

Thanks Andri


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

* Re: Linux board with 10 CANs
  2015-05-15 12:40         ` François Beaulier
@ 2015-05-15 12:47           ` Marc Kleine-Budde
  2015-05-15 13:04             ` AW: [BULK]Re: " Uwe Wilhelm (PEAK-System)
  0 siblings, 1 reply; 24+ messages in thread
From: Marc Kleine-Budde @ 2015-05-15 12:47 UTC (permalink / raw)
  To: François Beaulier, Andri Yngvason, Yegor Yefremov; +Cc: linux-can

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

On 05/15/2015 02:40 PM, François Beaulier wrote:
>> Have you considered FPGA?
>>
>> Andri
> I don't know much about FPGA, i can see in the kernel that there are 
> c_can and m_can drivers, i guess i have to add something like a PCIe 

c_can and m_can are IP cores by bosch, they are used in various SoCs.

> bridge to connect the CAN controllers with the SOC ?
> Is there a way to use FPGA that would not lead to driver development ?
> Do you have any link where i can learn more about Linux + FPGA + CAN ?

You have to use an IP core that is already supported by the kernel.

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

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

* Re: Linux board with 10 CANs
  2015-05-15 12:38       ` Gerhard Uttenthaler
@ 2015-05-15 12:48         ` Marc Kleine-Budde
  0 siblings, 0 replies; 24+ messages in thread
From: Marc Kleine-Budde @ 2015-05-15 12:48 UTC (permalink / raw)
  To: Gerhard Uttenthaler, François Beaulier, Yegor Yefremov; +Cc: linux-can

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

On 05/15/2015 02:38 PM, Gerhard Uttenthaler wrote:

>> Module based solutions are too expensive, whether it is PCIe or
>> USB. There are some bridge chips PCIe <-> memory, but i'm not
>> familiar with that. And you are right the SJA1000 is an old 5V
>> beast !

> Also a point to consider is that the speed you can read a SJA1000 chip
> is based on the clock frequency of this chip. And you have to
> read/write byte by byte. This may be too slow for 10 channels.

A local memory bus may be faster for single byte/word accesses than a
PCIe bus. I'm not a hardware guy, though :)

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

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

* AW: [BULK]Re: Linux board with 10 CANs
  2015-05-15 12:47           ` Marc Kleine-Budde
@ 2015-05-15 13:04             ` Uwe Wilhelm (PEAK-System)
  2015-05-15 13:17               ` Marc Kleine-Budde
  2015-05-15 14:18               ` François Beaulier
  0 siblings, 2 replies; 24+ messages in thread
From: Uwe Wilhelm (PEAK-System) @ 2015-05-15 13:04 UTC (permalink / raw)
  To: 'Marc Kleine-Budde', 'François Beaulier',
	'Andri Yngvason', 'Yegor Yefremov'
  Cc: linux-can



> -----Ursprüngliche Nachricht-----
> Von: linux-can-owner@vger.kernel.org [mailto:linux-can-
> owner@vger.kernel.org] Im Auftrag von Marc Kleine-Budde
> Gesendet: Freitag, 15. Mai 2015 14:47
> An: François Beaulier; Andri Yngvason; Yegor Yefremov
> Cc: linux-can@vger.kernel.org
> Betreff: [BULK]Re: Linux board with 10 CANs
> 
> On 05/15/2015 02:40 PM, François Beaulier wrote:
> >> Have you considered FPGA?
> >>
> >> Andri
> > I don't know much about FPGA, i can see in the kernel that there are
> > c_can and m_can drivers, i guess i have to add something like a PCIe
> 
> c_can and m_can are IP cores by bosch, they are used in various SoCs.
> 
> > bridge to connect the CAN controllers with the SOC ?
> > Is there a way to use FPGA that would not lead to driver development ?
> > Do you have any link where i can learn more about Linux + FPGA + CAN ?
> 
> You have to use an IP core that is already supported by the kernel.
> 
> Marc
> --

PEAK offer a 2 and a 4 CAN Channel FPGA Solution which support Socket CAN.  
A 12 Channel CAN card build with this Core is running under a Military Label 
without any problem with nearly 100% Busload per Channel / 1 Mbit
But you need 3 free PCIe 1x Lanes. Cost are cheap, because you only pay License, 
no Hardware - that’s up to you (you get the schematic).
You are 100% compatible to the PEAK PCIe based boards -- see WEB Page or google

Regards

   Uwe

PEAK-System Technik GmbH
E-mail:  support@peak-system.com 
Webseite: www.peak-system.com




--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt
Handelsregister Darmstadt HRB 9183 
Geschaeftsfuehrung: Alexander Gach, Uwe Wilhelm
--

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

* Re: AW: [BULK]Re: Linux board with 10 CANs
  2015-05-15 13:04             ` AW: [BULK]Re: " Uwe Wilhelm (PEAK-System)
@ 2015-05-15 13:17               ` Marc Kleine-Budde
  2015-05-15 13:20                 ` AW: " Uwe Wilhelm (PEAK-System)
  2015-05-15 14:18               ` François Beaulier
  1 sibling, 1 reply; 24+ messages in thread
From: Marc Kleine-Budde @ 2015-05-15 13:17 UTC (permalink / raw)
  To: Uwe Wilhelm (PEAK-System), 'François Beaulier',
	'Andri Yngvason', 'Yegor Yefremov'
  Cc: linux-can

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

On 05/15/2015 03:04 PM, Uwe Wilhelm (PEAK-System) wrote:
> 
> 
>> -----Ursprüngliche Nachricht-----
>> Von: linux-can-owner@vger.kernel.org [mailto:linux-can-
>> owner@vger.kernel.org] Im Auftrag von Marc Kleine-Budde
>> Gesendet: Freitag, 15. Mai 2015 14:47
>> An: François Beaulier; Andri Yngvason; Yegor Yefremov
>> Cc: linux-can@vger.kernel.org
>> Betreff: [BULK]Re: Linux board with 10 CANs
>>
>> On 05/15/2015 02:40 PM, François Beaulier wrote:
>>>> Have you considered FPGA?
>>>>
>>>> Andri
>>> I don't know much about FPGA, i can see in the kernel that there are
>>> c_can and m_can drivers, i guess i have to add something like a PCIe
>>
>> c_can and m_can are IP cores by bosch, they are used in various SoCs.
>>
>>> bridge to connect the CAN controllers with the SOC ?
>>> Is there a way to use FPGA that would not lead to driver development ?
>>> Do you have any link where i can learn more about Linux + FPGA + CAN ?
>>
>> You have to use an IP core that is already supported by the kernel.
>>
>> Marc
>> --
> 
> PEAK offer a 2 and a 4 CAN Channel FPGA Solution which support Socket CAN.  
> A 12 Channel CAN card build with this Core is running under a Military Label 
> without any problem with nearly 100% Busload per Channel / 1 Mbit
> But you need 3 free PCIe 1x Lanes. Cost are cheap, because you only pay License, 

That is 3 IP-Core instances with 4 Channels/1 PCIe Lane each?

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

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

* AW: AW: [BULK]Re: Linux board with 10 CANs
  2015-05-15 13:17               ` Marc Kleine-Budde
@ 2015-05-15 13:20                 ` Uwe Wilhelm (PEAK-System)
  0 siblings, 0 replies; 24+ messages in thread
From: Uwe Wilhelm (PEAK-System) @ 2015-05-15 13:20 UTC (permalink / raw)
  To: 'Marc Kleine-Budde', 'François Beaulier',
	'Andri Yngvason', 'Yegor Yefremov'
  Cc: linux-can


> -----Ursprüngliche Nachricht-----
> Von: Marc Kleine-Budde [mailto:mkl@pengutronix.de]
> Gesendet: Freitag, 15. Mai 2015 15:18
> An: Uwe Wilhelm (PEAK-System); 'François Beaulier'; 'Andri Yngvason'; 'Yegor
> Yefremov'
> Cc: linux-can@vger.kernel.org
> Betreff: Re: AW: [BULK]Re: Linux board with 10 CANs
> 
> On 05/15/2015 03:04 PM, Uwe Wilhelm (PEAK-System) wrote:
> >
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: linux-can-owner@vger.kernel.org [mailto:linux-can-
> >> owner@vger.kernel.org] Im Auftrag von Marc Kleine-Budde
> >> Gesendet: Freitag, 15. Mai 2015 14:47
> >> An: François Beaulier; Andri Yngvason; Yegor Yefremov
> >> Cc: linux-can@vger.kernel.org
> >> Betreff: [BULK]Re: Linux board with 10 CANs
> >>
> >> On 05/15/2015 02:40 PM, François Beaulier wrote:
> >>>> Have you considered FPGA?
> >>>>
> >>>> Andri
> >>> I don't know much about FPGA, i can see in the kernel that there are
> >>> c_can and m_can drivers, i guess i have to add something like a PCIe
> >>
> >> c_can and m_can are IP cores by bosch, they are used in various SoCs.
> >>
> >>> bridge to connect the CAN controllers with the SOC ?
> >>> Is there a way to use FPGA that would not lead to driver development ?
> >>> Do you have any link where i can learn more about Linux + FPGA + CAN ?
> >>
> >> You have to use an IP core that is already supported by the kernel.
> >>
> >> Marc
> >> --
> >
> > PEAK offer a 2 and a 4 CAN Channel FPGA Solution which support Socket CAN.
> > A 12 Channel CAN card build with this Core is running under a Military
> > Label without any problem with nearly 100% Busload per Channel / 1
> > Mbit But you need 3 free PCIe 1x Lanes. Cost are cheap, because you
> > only pay License,
> 
> That is 3 IP-Core instances with 4 Channels/1 PCIe Lane each?

Yes, every FPGA have it´s own PCIe Interface and max. 4 CAN Controller inside

--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt
Handelsregister Darmstadt HRB 9183 
Geschaeftsfuehrung: Alexander Gach, Uwe Wilhelm
--

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

* Re: Linux board with 10 CANs
  2015-05-15  7:56 Linux board with 10 CANs François Beaulier
  2015-05-15  8:20 ` Yegor Yefremov
@ 2015-05-15 13:54 ` Bernd Krumboeck
  2015-05-18  9:07   ` François Beaulier
  2015-05-15 15:24 ` Tom Evans
  2 siblings, 1 reply; 24+ messages in thread
From: Bernd Krumboeck @ 2015-05-15 13:54 UTC (permalink / raw)
  To: François Beaulier, linux-can

Hi!


I don't know much about this things, but what do you think about following:

Use two 4 port usb hub (MICROCHIP USB4624I-1080HN) with 8 x STM32F072 or STR750FV2.

You can flash the MCUs under linux with dfu-util (http://dfu-util.sourceforge.net/).

A firmware for STR750FV2 is available here (please check license):
https://github.com/krumboeck/usb2can_firmware

I don't know if it works, but there is also a gcc version available:
https://github.com/krumboeck/usb2can_firmware/tree/gcc-test


If you use this firmware or at least the same procotol, then the
hardware will be compatible with usb_8dev can driver.


regards,
Bernd




Am 2015-05-15 um 09:56 schrieb François Beaulier:
> Hi,
>
> I'm starting the design of a CPU board, based on a computer on module with a very common SOC like i.mx6 or am335x.
> I need to fit my board with at least 10 CAN ports, may be more. (The SOC have 2 CANs so i need 8 more)
> The board will run with Linux and of course i want a socketcan interface for each bus !
> CAN bitrate needed is quite low (50kbps) and latency is not critical but bus load may reach 100% sometimes.
> As far as possible i want to avoid driver development, or just doing slight modifications on an existing driver.
> I don't want to use MCP2515, i had trouble with it on a previous design because of the lack of buffer in the chip.
> I can't imagine putting 8 MCP2515 and not missing any frame, but may be i'm wrong ?
>
> Here are the options i have considered, they involve using external MCUs to provide enough CAN interfaces :
>
> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it should offer enough performance at low data rate. Problem is that it would require 8 UARTS. I could modify SLCAN driver to allow multiple CAN channels on the same UART, and so use MCUs with multiple CANs, does it sounds reasonable ?
>
> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI protocol manageable on the MCU side (SPI slave). The MCU will be able to provide the buffer for CAN frames that the MCP does not have. This option is just a way of trying to go fast, it is not very elegant, and have the limitation of one CAN channel per SPI connection / driver instance.
>
> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this list. This is probably the best choice for a long term and more generic solution. But i'm afraid it may require too much work to complete. What is the status of this driver right now ? Does anyone have an idea of the remaining work to do to make it ready for mainline ? Stefano are you available to spend more time on it ? I'm also wondering whether multiple instances of the driver can run concurently if i put more than one MCU ?
>
> Concerning the MCU software i could release it as an open-source project, anyone interested in participating ?
> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 (low cost cortex M0 with one CAN).
>
> Any idea or advice is welcome, thank you for reading this much too long post.
>
> Regards
>
> Francois Beaulier
> www.ingelibre.fr
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: AW: [BULK]Re: Linux board with 10 CANs
  2015-05-15 13:04             ` AW: [BULK]Re: " Uwe Wilhelm (PEAK-System)
  2015-05-15 13:17               ` Marc Kleine-Budde
@ 2015-05-15 14:18               ` François Beaulier
  1 sibling, 0 replies; 24+ messages in thread
From: François Beaulier @ 2015-05-15 14:18 UTC (permalink / raw)
  To: Uwe Wilhelm (PEAK-System), 'Marc Kleine-Budde',
	'Andri Yngvason', 'Yegor Yefremov'
  Cc: linux-can

Le 15/05/2015 15:04, Uwe Wilhelm (PEAK-System) a écrit :
>
>> -----Ursprüngliche Nachricht-----
>> Von: linux-can-owner@vger.kernel.org [mailto:linux-can-
>> owner@vger.kernel.org] Im Auftrag von Marc Kleine-Budde
>> Gesendet: Freitag, 15. Mai 2015 14:47
>> An: François Beaulier; Andri Yngvason; Yegor Yefremov
>> Cc: linux-can@vger.kernel.org
>> Betreff: [BULK]Re: Linux board with 10 CANs
>>
>> On 05/15/2015 02:40 PM, François Beaulier wrote:
>>>> Have you considered FPGA?
>>>>
>>>> Andri
>>> I don't know much about FPGA, i can see in the kernel that there are
>>> c_can and m_can drivers, i guess i have to add something like a PCIe
>> c_can and m_can are IP cores by bosch, they are used in various SoCs.
>>
>>> bridge to connect the CAN controllers with the SOC ?
>>> Is there a way to use FPGA that would not lead to driver development ?
>>> Do you have any link where i can learn more about Linux + FPGA + CAN ?
>> You have to use an IP core that is already supported by the kernel.
>>
>> Marc
>> --
> PEAK offer a 2 and a 4 CAN Channel FPGA Solution which support Socket CAN.
> A 12 Channel CAN card build with this Core is running under a Military Label
> without any problem with nearly 100% Busload per Channel / 1 Mbit
> But you need 3 free PCIe 1x Lanes. Cost are cheap, because you only pay License,
> no Hardware - that’s up to you (you get the schematic).
> You are 100% compatible to the PEAK PCIe based boards -- see WEB Page or google
Interesting but i.mx6 have only one PCIe lane and other low cost SOCs 
often have no PCIe at all.
I will think twice about it because having a fully ready and supported 
driver is a huge plus !

Francois

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

* Re: Linux board with 10 CANs
  2015-05-15  7:56 Linux board with 10 CANs François Beaulier
  2015-05-15  8:20 ` Yegor Yefremov
  2015-05-15 13:54 ` Bernd Krumboeck
@ 2015-05-15 15:24 ` Tom Evans
  2015-05-18  9:25   ` François Beaulier
  2 siblings, 1 reply; 24+ messages in thread
From: Tom Evans @ 2015-05-15 15:24 UTC (permalink / raw)
  To: François Beaulier, linux-can

On 15/05/2015 5:56 PM, François Beaulier wrote:
> Hi,
>
> I'm starting the design of a CPU board, based on a computer on module
> with a very common SOC like i.mx6 or am335x.

There are SOCs with 8 CAN ports built in, like the Freescale MPC574X 
chips. That should be a lot easier to work with, and should be supported 
without any extra drivers.

The following Selector Guide tells me the Vybrid SVFxxxR has *FIFTY* CAN 
ports. That may have multiple typos, as Freescale's web site doesn't 
admit to that part.

http://cache.freescale.com/files/microcontrollers/doc/roadmap/BRAUTOPRDCTMAP.pdf

> CAN bitrate needed is quite low (50kbps)

So at about 110 bits for a minimum sized Standard ID packet, that gives 
you 450 messages/second max. That gives you a maximum service latency of 
2.2ms for as many buffers as the chip has. If your data has 8 
bytes/packet then that drops to 3.5ms/buffer (7ms for a chip with 2).

That wouldn't be impossible with MCP2515s, just inadvisable. Especially 
with Linux as it isn't good at any service guarantees.

But I've successfully run three MCP2515's on a Coldfire part. The QSPI 
helps a lot. There are a lot of parts with multiple QSPI ports, and that 
makes it less onerous (or DSPI or ECSPI). The i.MX6D has 5 on it. So two 
"real" CAN ports and two MCP2515's on each of the SPI ports, with a 
spare SPI port. Or three per port.

> I don't want to use MCP2515, i had trouble with it on a previous
 > design because of the lack of buffer in the chip.
> I can't imagine putting 8 MCP2515 and not missing any frame, but may be
> i'm wrong ?

Did you turn the BUKT bit on? If you spread them across lots of SPI 
interfaces it should get easier as they should all be accessed in parallel.

Tom


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

* Re: Linux board with 10 CANs
  2015-05-15 13:54 ` Bernd Krumboeck
@ 2015-05-18  9:07   ` François Beaulier
  2015-05-18 13:31     ` Bernd Krumboeck
  0 siblings, 1 reply; 24+ messages in thread
From: François Beaulier @ 2015-05-18  9:07 UTC (permalink / raw)
  To: Bernd Krumboeck, linux-can

Le 15/05/2015 15:54, Bernd Krumboeck a écrit :
> Hi!
>
>
> I don't know much about this things, but what do you think about 
> following:
>
> Use two 4 port usb hub (MICROCHIP USB4624I-1080HN) with 8 x STM32F072 
> or STR750FV2.
>
> You can flash the MCUs under linux with dfu-util 
> (http://dfu-util.sourceforge.net/).
>
> A firmware for STR750FV2 is available here (please check license):
> https://github.com/krumboeck/usb2can_firmware
>
> I don't know if it works, but there is also a gcc version available:
> https://github.com/krumboeck/usb2can_firmware/tree/gcc-test
>
>
> If you use this firmware or at least the same procotol, then the
> hardware will be compatible with usb_8dev can driver.
>
>
> regards,
> Bernd
>
>

Hi Bernd,

Thank you for pointed out this USB solution. I didn't know such firmware 
existed.
I looked in the gcc-test repository, and apart from ST files the license 
is not specified.
Can you tell us more about license ?

Francois


>
>
> Am 2015-05-15 um 09:56 schrieb François Beaulier:
>> Hi,
>>
>> I'm starting the design of a CPU board, based on a computer on module 
>> with a very common SOC like i.mx6 or am335x.
>> I need to fit my board with at least 10 CAN ports, may be more. (The 
>> SOC have 2 CANs so i need 8 more)
>> The board will run with Linux and of course i want a socketcan 
>> interface for each bus !
>> CAN bitrate needed is quite low (50kbps) and latency is not critical 
>> but bus load may reach 100% sometimes.
>> As far as possible i want to avoid driver development, or just doing 
>> slight modifications on an existing driver.
>> I don't want to use MCP2515, i had trouble with it on a previous 
>> design because of the lack of buffer in the chip.
>> I can't imagine putting 8 MCP2515 and not missing any frame, but may 
>> be i'm wrong ?
>>
>> Here are the options i have considered, they involve using external 
>> MCUs to provide enough CAN interfaces :
>>
>> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it 
>> should offer enough performance at low data rate. Problem is that it 
>> would require 8 UARTS. I could modify SLCAN driver to allow multiple 
>> CAN channels on the same UART, and so use MCUs with multiple CANs, 
>> does it sounds reasonable ?
>>
>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI 
>> protocol manageable on the MCU side (SPI slave). The MCU will be able 
>> to provide the buffer for CAN frames that the MCP does not have. This 
>> option is just a way of trying to go fast, it is not very elegant, 
>> and have the limitation of one CAN channel per SPI connection / 
>> driver instance.
>>
>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this 
>> list. This is probably the best choice for a long term and more 
>> generic solution. But i'm afraid it may require too much work to 
>> complete. What is the status of this driver right now ? Does anyone 
>> have an idea of the remaining work to do to make it ready for 
>> mainline ? Stefano are you available to spend more time on it ? I'm 
>> also wondering whether multiple instances of the driver can run 
>> concurently if i put more than one MCU ?
>>
>> Concerning the MCU software i could release it as an open-source 
>> project, anyone interested in participating ?
>> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 
>> (low cost cortex M0 with one CAN).
>>
>> Any idea or advice is welcome, thank you for reading this much too 
>> long post.
>>
>> Regards
>>
>> Francois Beaulier
>> www.ingelibre.fr
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


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

* Re: Linux board with 10 CANs
  2015-05-15 15:24 ` Tom Evans
@ 2015-05-18  9:25   ` François Beaulier
  2015-05-18  9:40     ` Gerhard Bertelsmann
  0 siblings, 1 reply; 24+ messages in thread
From: François Beaulier @ 2015-05-18  9:25 UTC (permalink / raw)
  To: Tom Evans, linux-can

Hi Tom,

Freescale MPC574X chips are MCUs, you can't run Linux on them.
Vybrid SOCs have 2 CANs max.
I know the MCP2515 may work in some situation but it depends on kernel 
latency and that is very unpredictable.
What is helping in QSPI ? the main problem beeing latency between MCP 
irq and effective SPI transfer ?

Francois


Le 15/05/2015 17:24, Tom Evans a écrit :
> On 15/05/2015 5:56 PM, François Beaulier wrote:
>> Hi,
>>
>> I'm starting the design of a CPU board, based on a computer on module
>> with a very common SOC like i.mx6 or am335x.
>
> There are SOCs with 8 CAN ports built in, like the Freescale MPC574X 
> chips. That should be a lot easier to work with, and should be 
> supported without any extra drivers.
>
> The following Selector Guide tells me the Vybrid SVFxxxR has *FIFTY* 
> CAN ports. That may have multiple typos, as Freescale's web site 
> doesn't admit to that part.
>
> http://cache.freescale.com/files/microcontrollers/doc/roadmap/BRAUTOPRDCTMAP.pdf 
>
>
>> CAN bitrate needed is quite low (50kbps)
>
> So at about 110 bits for a minimum sized Standard ID packet, that 
> gives you 450 messages/second max. That gives you a maximum service 
> latency of 2.2ms for as many buffers as the chip has. If your data has 
> 8 bytes/packet then that drops to 3.5ms/buffer (7ms for a chip with 2).
>
> That wouldn't be impossible with MCP2515s, just inadvisable. 
> Especially with Linux as it isn't good at any service guarantees.
>
> But I've successfully run three MCP2515's on a Coldfire part. The QSPI 
> helps a lot. There are a lot of parts with multiple QSPI ports, and 
> that makes it less onerous (or DSPI or ECSPI). The i.MX6D has 5 on it. 
> So two "real" CAN ports and two MCP2515's on each of the SPI ports, 
> with a spare SPI port. Or three per port.
>
>> I don't want to use MCP2515, i had trouble with it on a previous
> > design because of the lack of buffer in the chip.
>> I can't imagine putting 8 MCP2515 and not missing any frame, but may be
>> i'm wrong ?
>
> Did you turn the BUKT bit on? If you spread them across lots of SPI 
> interfaces it should get easier as they should all be accessed in 
> parallel.
>
> Tom
>


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

* Re: Linux board with 10 CANs
  2015-05-18  9:25   ` François Beaulier
@ 2015-05-18  9:40     ` Gerhard Bertelsmann
  2015-05-18 11:13       ` François Beaulier
  2015-05-18 12:56       ` Tom Evans
  0 siblings, 2 replies; 24+ messages in thread
From: Gerhard Bertelsmann @ 2015-05-18  9:40 UTC (permalink / raw)
  To: François Beaulier; +Cc: Tom Evans, linux-can

Hi Francois,
Am Mo, 18.05.2015, 11:25, schrieb François Beaulier:
> Hi Tom,
>
> Freescale MPC574X chips are MCUs, you can't run Linux on them.
> Vybrid SOCs have 2 CANs max.
> I know the MCP2515 may work in some situation but it depends on kernel
> latency and that is very unpredictable.
> What is helping in QSPI ? the main problem beeing latency between MCP
> irq and effective SPI transfer ?

Yes, latency is the main problem with the MCP2515 connected via SPI.
But I have no doubt that it would be possible using a BeagleBone Black
with it's two integrated PRUs (2x200 MHz MCUs). If you connect 4 MCP2515
to each PRU they could be served even at 1MBit @ full speed. With
the already 2 integrated CAN controller you can easily have 10 CANs.

The only concern that I have is the latency/overhead of the SocketCAN
API with 10 CANs at high packet rates on 1 GHz ARM ...

Regards

Gerd


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

* Re: Linux board with 10 CANs
  2015-05-18  9:40     ` Gerhard Bertelsmann
@ 2015-05-18 11:13       ` François Beaulier
  2015-05-18 12:56       ` Tom Evans
  1 sibling, 0 replies; 24+ messages in thread
From: François Beaulier @ 2015-05-18 11:13 UTC (permalink / raw)
  To: info; +Cc: Tom Evans, linux-can

Le 18/05/2015 11:40, Gerhard Bertelsmann a écrit :
> Hi Francois,
> Am Mo, 18.05.2015, 11:25, schrieb François Beaulier:
>> Hi Tom,
>>
>> Freescale MPC574X chips are MCUs, you can't run Linux on them.
>> Vybrid SOCs have 2 CANs max.
>> I know the MCP2515 may work in some situation but it depends on kernel
>> latency and that is very unpredictable.
>> What is helping in QSPI ? the main problem beeing latency between MCP
>> irq and effective SPI transfer ?
> Yes, latency is the main problem with the MCP2515 connected via SPI.
> But I have no doubt that it would be possible using a BeagleBone Black
> with it's two integrated PRUs (2x200 MHz MCUs). If you connect 4 MCP2515
> to each PRU they could be served even at 1MBit @ full speed. With
> the already 2 integrated CAN controller you can easily have 10 CANs.
>
> The only concern that I have is the latency/overhead of the SocketCAN
> API with 10 CANs at high packet rates on 1 GHz ARM ...
>
> Regards
>
> Gerd
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Hi Gerhard,

Yes i agree it should work with AM335x PRUs.
MCP2515 can easily be well managed with any MCU, whether it is a PRU or 
a Cortex-M like those inside the Vybrid or the iMX6 soloX.
The problem is the associated socketcan Linux driver.
It is probably simpler to write the driver when the MCU is inside the 
SOC than it is when the MCU is connected with SPI because we can 
directly read / write values through shared memory (+ use of semaphores).
But still, there is a new driver to write !

Regards,

Francois

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

* Re: Linux board with 10 CANs
  2015-05-18  9:40     ` Gerhard Bertelsmann
  2015-05-18 11:13       ` François Beaulier
@ 2015-05-18 12:56       ` Tom Evans
  1 sibling, 0 replies; 24+ messages in thread
From: Tom Evans @ 2015-05-18 12:56 UTC (permalink / raw)
  To: info, François Beaulier; +Cc: linux-can

On 18/05/2015 7:40 PM, Gerhard Bertelsmann wrote:
> Hi Francois,
> Am Mo, 18.05.2015, 11:25, schrieb François Beaulier:
>> I know the MCP2515 may work in some situation but it depends on kernel
>> latency and that is very unpredictable.

You can always try running RT or Xenomai. I wouldn't recommend that.

We had trouble with Linux kernel latency, until I found our supplier had 
shipped Linux with a whole bunch of debugging turned on. We got rid of 
CONFIG_DEBUG_PAGEALLOC, SPIN, MUTEX, and SLUB debugging and it got a lot 
more responsive. I had to trace the kernel to find out where it was 
spending all its time (in SLUB debugging mainly).

We're running two FlexCAN ports, each with a 6-deep FIFO at 1MHz each. 
We're not having any problems now [1]. You're wanting to run at 1/20 of 
that data rate with 1/3 of the FIFO depth. That should work, even with 
10 of them running.

Note 1: The CAN driver deferred reading data to NAPI, the debugs were on 
and the (old non-NAPI) Ethernet driver happily kept pulling hundreds of 
Ethernet packets in during one interrupt, so I was getting CAN overruns. 
I rewrote the CAN driver to read message data during Interrupts, 
throttled Ethernet and added interrupt priority and turned the debugs 
off. Now it is fine.

>> What is helping in QSPI ?

Instead of your GHZ CPU having to wait for a 10MHz SPI bus to send a 
byte, or be interrupted once per byte, it can load up 16 multi-byte 
transactions and be interrupted when the whole thing is complete. I 
don't know how good the SPI drivers are and how well the Linux MCP2515 
driver supports this (if it supports the hardware queue). It looks like 
it reads a whole CAN message in a single SPI transaction though.

>> the main problem beeing latency between
 >> MCP irq and effective SPI transfer ?

Go Multicore and spread the load, or keep long latency stuff of the CAN 
core.

> The only concern that I have is the latency/overhead of the SocketCAN
> API with 10 CANs at high packet rates on 1 GHz ARM ...

The interrupts, NAPI and SocketCAN switches and code all add about the 
same overhead to each message processed. Multiple interrupts, a NAPI run 
and SocketCAN context switch for 8 bytes of user data (or maybe even one 
or no bytes) is a pain. CAN and Linux really weren't mean to get on and 
it shows.

Or you could run 5 complete CPUs, networked via Ethernet.

The USB solution looks good, as long as the USB is reliable.

Tom


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

* Re: Linux board with 10 CANs
  2015-05-18  9:07   ` François Beaulier
@ 2015-05-18 13:31     ` Bernd Krumboeck
  2015-05-20 11:35       ` Gediminas Simanskis
  0 siblings, 1 reply; 24+ messages in thread
From: Bernd Krumboeck @ 2015-05-18 13:31 UTC (permalink / raw)
  To: Gediminas Simanskis; +Cc: François Beaulier, linux-can

Hi Gediminas!


Can you tell us the license of the source code from usb2can firmware?


regards,
Bernd


Am 2015-05-18 um 11:07 schrieb François Beaulier:
> Le 15/05/2015 15:54, Bernd Krumboeck a écrit :
>> Hi!
>>
>>
>> I don't know much about this things, but what do you think about following:
>>
>> Use two 4 port usb hub (MICROCHIP USB4624I-1080HN) with 8 x STM32F072 or STR750FV2.
>>
>> You can flash the MCUs under linux with dfu-util (http://dfu-util.sourceforge.net/).
>>
>> A firmware for STR750FV2 is available here (please check license):
>> https://github.com/krumboeck/usb2can_firmware
>>
>> I don't know if it works, but there is also a gcc version available:
>> https://github.com/krumboeck/usb2can_firmware/tree/gcc-test
>>
>>
>> If you use this firmware or at least the same procotol, then the
>> hardware will be compatible with usb_8dev can driver.
>>
>>
>> regards,
>> Bernd
>>
>>
>
> Hi Bernd,
>
> Thank you for pointed out this USB solution. I didn't know such firmware existed.
> I looked in the gcc-test repository, and apart from ST files the license is not specified.
> Can you tell us more about license ?
>
> Francois
>
>
>>
>>
>> Am 2015-05-15 um 09:56 schrieb François Beaulier:
>>> Hi,
>>>
>>> I'm starting the design of a CPU board, based on a computer on module with a very common SOC like i.mx6 or am335x.
>>> I need to fit my board with at least 10 CAN ports, may be more. (The SOC have 2 CANs so i need 8 more)
>>> The board will run with Linux and of course i want a socketcan interface for each bus !
>>> CAN bitrate needed is quite low (50kbps) and latency is not critical but bus load may reach 100% sometimes.
>>> As far as possible i want to avoid driver development, or just doing slight modifications on an existing driver.
>>> I don't want to use MCP2515, i had trouble with it on a previous design because of the lack of buffer in the chip.
>>> I can't imagine putting 8 MCP2515 and not missing any frame, but may be i'm wrong ?
>>>
>>> Here are the options i have considered, they involve using external MCUs to provide enough CAN interfaces :
>>>
>>> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it should offer enough performance at low data rate. Problem is that it would require 8 UARTS. I could modify SLCAN driver to allow multiple CAN channels on the same UART, and so use MCUs with multiple CANs, does it sounds reasonable ?
>>>
>>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI protocol manageable on the MCU side (SPI slave). The MCU will be able to provide the buffer for CAN frames that the MCP does not have. This option is just a way of trying to go fast, it is not very elegant, and have the limitation of one CAN channel per SPI connection / driver instance.
>>>
>>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this list. This is probably the best choice for a long term and more generic solution. But i'm afraid it may require too much work to complete. What is the status of this driver right now ? Does anyone have an idea of the remaining work to do to make it ready for mainline ? Stefano are you available to spend more time on it ? I'm also wondering whether multiple instances of the driver can run concurently if i put more than one MCU ?
>>>
>>> Concerning the MCU software i could release it as an open-source project, anyone interested in participating ?
>>> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 (low cost cortex M0 with one CAN).
>>>
>>> Any idea or advice is welcome, thank you for reading this much too long post.
>>>
>>> Regards
>>>
>>> Francois Beaulier
>>> www.ingelibre.fr
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

* Re: Linux board with 10 CANs
  2015-05-18 13:31     ` Bernd Krumboeck
@ 2015-05-20 11:35       ` Gediminas Simanskis
  2015-05-21  3:19         ` Bernd Krumboeck
  0 siblings, 1 reply; 24+ messages in thread
From: Gediminas Simanskis @ 2015-05-20 11:35 UTC (permalink / raw)
  To: Bernd Krumboeck; +Cc: François Beaulier, linux-can

Hi,
GPL2
Gediminas

On 2015-05-18 16:31, Bernd Krumboeck wrote:
> Hi Gediminas!
>
>
> Can you tell us the license of the source code from usb2can firmware?
>
>
> regards,
> Bernd
>
>
> Am 2015-05-18 um 11:07 schrieb François Beaulier:
>> Le 15/05/2015 15:54, Bernd Krumboeck a écrit :
>>> Hi!
>>>
>>>
>>> I don't know much about this things, but what do you think about 
>>> following:
>>>
>>> Use two 4 port usb hub (MICROCHIP USB4624I-1080HN) with 8 x 
>>> STM32F072 or STR750FV2.
>>>
>>> You can flash the MCUs under linux with dfu-util 
>>> (http://dfu-util.sourceforge.net/).
>>>
>>> A firmware for STR750FV2 is available here (please check license):
>>> https://github.com/krumboeck/usb2can_firmware
>>>
>>> I don't know if it works, but there is also a gcc version available:
>>> https://github.com/krumboeck/usb2can_firmware/tree/gcc-test
>>>
>>>
>>> If you use this firmware or at least the same procotol, then the
>>> hardware will be compatible with usb_8dev can driver.
>>>
>>>
>>> regards,
>>> Bernd
>>>
>>>
>>
>> Hi Bernd,
>>
>> Thank you for pointed out this USB solution. I didn't know such 
>> firmware existed.
>> I looked in the gcc-test repository, and apart from ST files the 
>> license is not specified.
>> Can you tell us more about license ?
>>
>> Francois
>>
>>
>>>
>>>
>>> Am 2015-05-15 um 09:56 schrieb François Beaulier:
>>>> Hi,
>>>>
>>>> I'm starting the design of a CPU board, based on a computer on 
>>>> module with a very common SOC like i.mx6 or am335x.
>>>> I need to fit my board with at least 10 CAN ports, may be more. 
>>>> (The SOC have 2 CANs so i need 8 more)
>>>> The board will run with Linux and of course i want a socketcan 
>>>> interface for each bus !
>>>> CAN bitrate needed is quite low (50kbps) and latency is not 
>>>> critical but bus load may reach 100% sometimes.
>>>> As far as possible i want to avoid driver development, or just 
>>>> doing slight modifications on an existing driver.
>>>> I don't want to use MCP2515, i had trouble with it on a previous 
>>>> design because of the lack of buffer in the chip.
>>>> I can't imagine putting 8 MCP2515 and not missing any frame, but 
>>>> may be i'm wrong ?
>>>>
>>>> Here are the options i have considered, they involve using external 
>>>> MCUs to provide enough CAN interfaces :
>>>>
>>>> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it 
>>>> should offer enough performance at low data rate. Problem is that 
>>>> it would require 8 UARTS. I could modify SLCAN driver to allow 
>>>> multiple CAN channels on the same UART, and so use MCUs with 
>>>> multiple CANs, does it sounds reasonable ?
>>>>
>>>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI 
>>>> protocol manageable on the MCU side (SPI slave). The MCU will be 
>>>> able to provide the buffer for CAN frames that the MCP does not 
>>>> have. This option is just a way of trying to go fast, it is not 
>>>> very elegant, and have the limitation of one CAN channel per SPI 
>>>> connection / driver instance.
>>>>
>>>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this 
>>>> list. This is probably the best choice for a long term and more 
>>>> generic solution. But i'm afraid it may require too much work to 
>>>> complete. What is the status of this driver right now ? Does anyone 
>>>> have an idea of the remaining work to do to make it ready for 
>>>> mainline ? Stefano are you available to spend more time on it ? I'm 
>>>> also wondering whether multiple instances of the driver can run 
>>>> concurently if i put more than one MCU ?
>>>>
>>>> Concerning the MCU software i could release it as an open-source 
>>>> project, anyone interested in participating ?
>>>> I'm very familiar with STM32 MCUs so i will probably use an 
>>>> STM32F072 (low cost cortex M0 with one CAN).
>>>>
>>>> Any idea or advice is welcome, thank you for reading this much too 
>>>> long post.
>>>>
>>>> Regards
>>>>
>>>> Francois Beaulier
>>>> www.ingelibre.fr
>>>> -- 
>>>> To unsubscribe from this list: send the line "unsubscribe 
>>>> linux-can" in
>>>> the body of a message to majordomo@vger.kernel.org
>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


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

* Re: Linux board with 10 CANs
  2015-05-20 11:35       ` Gediminas Simanskis
@ 2015-05-21  3:19         ` Bernd Krumboeck
  0 siblings, 0 replies; 24+ messages in thread
From: Bernd Krumboeck @ 2015-05-21  3:19 UTC (permalink / raw)
  To: Gediminas Simanskis; +Cc: François Beaulier, linux-can

Thank you for the fast response.
I'll update the notes on github (asap).


regards,
Bernd


Am 2015-05-20 um 13:35 schrieb Gediminas Simanskis:
> Hi,
> GPL2
> Gediminas
>
> On 2015-05-18 16:31, Bernd Krumboeck wrote:
>> Hi Gediminas!
>>
>>
>> Can you tell us the license of the source code from usb2can firmware?
>>
>>
>> regards,
>> Bernd
>>
>>
>> Am 2015-05-18 um 11:07 schrieb François Beaulier:
>>> Le 15/05/2015 15:54, Bernd Krumboeck a écrit :
>>>> Hi!
>>>>
>>>>
>>>> I don't know much about this things, but what do you think about following:
>>>>
>>>> Use two 4 port usb hub (MICROCHIP USB4624I-1080HN) with 8 x STM32F072 or STR750FV2.
>>>>
>>>> You can flash the MCUs under linux with dfu-util (http://dfu-util.sourceforge.net/).
>>>>
>>>> A firmware for STR750FV2 is available here (please check license):
>>>> https://github.com/krumboeck/usb2can_firmware
>>>>
>>>> I don't know if it works, but there is also a gcc version available:
>>>> https://github.com/krumboeck/usb2can_firmware/tree/gcc-test
>>>>
>>>>
>>>> If you use this firmware or at least the same procotol, then the
>>>> hardware will be compatible with usb_8dev can driver.
>>>>
>>>>
>>>> regards,
>>>> Bernd
>>>>
>>>>
>>>
>>> Hi Bernd,
>>>
>>> Thank you for pointed out this USB solution. I didn't know such firmware existed.
>>> I looked in the gcc-test repository, and apart from ST files the license is not specified.
>>> Can you tell us more about license ?
>>>
>>> Francois
>>>
>>>
>>>>
>>>>
>>>> Am 2015-05-15 um 09:56 schrieb François Beaulier:
>>>>> Hi,
>>>>>
>>>>> I'm starting the design of a CPU board, based on a computer on module with a very common SOC like i.mx6 or am335x.
>>>>> I need to fit my board with at least 10 CAN ports, may be more. (The SOC have 2 CANs so i need 8 more)
>>>>> The board will run with Linux and of course i want a socketcan interface for each bus !
>>>>> CAN bitrate needed is quite low (50kbps) and latency is not critical but bus load may reach 100% sometimes.
>>>>> As far as possible i want to avoid driver development, or just doing slight modifications on an existing driver.
>>>>> I don't want to use MCP2515, i had trouble with it on a previous design because of the lack of buffer in the chip.
>>>>> I can't imagine putting 8 MCP2515 and not missing any frame, but may be i'm wrong ?
>>>>>
>>>>> Here are the options i have considered, they involve using external MCUs to provide enough CAN interfaces :
>>>>>
>>>>> - MCUs with SLCAN : SLCAN have the advantage of simplicity and it should offer enough performance at low data rate. Problem is that it would require 8 UARTS. I could modify SLCAN driver to allow multiple CAN channels on the same UART, and so use MCUs with multiple CANs, does it sounds reasonable ?
>>>>>
>>>>> - MCUs with SPI 1 : adapt MCP2515 driver in a way to make the SPI protocol manageable on the MCU side (SPI slave). The MCU will be able to provide the buffer for CAN frames that the MCP does not have. This option is just a way of trying to go fast, it is not very elegant, and have the limitation of one CAN channel per SPI connection / driver instance.
>>>>>
>>>>> - MCUs with SPI 2 : use the Stefano Babic SPI driver posted on this list. This is probably the best choice for a long term and more generic solution. But i'm afraid it may require too much work to complete. What is the status of this driver right now ? Does anyone have an idea of the remaining work to do to make it ready for mainline ? Stefano are you available to spend more time on it ? I'm also wondering whether multiple instances of the driver can run concurently if i put more than one MCU ?
>>>>>
>>>>> Concerning the MCU software i could release it as an open-source project, anyone interested in participating ?
>>>>> I'm very familiar with STM32 MCUs so i will probably use an STM32F072 (low cost cortex M0 with one CAN).
>>>>>
>>>>> Any idea or advice is welcome, thank you for reading this much too long post.
>>>>>
>>>>> Regards
>>>>>
>>>>> Francois Beaulier
>>>>> www.ingelibre.fr
>>>>> --
>>>>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>>>>> the body of a message to majordomo@vger.kernel.org
>>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>>
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2015-05-21  3:20 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-15  7:56 Linux board with 10 CANs François Beaulier
2015-05-15  8:20 ` Yegor Yefremov
2015-05-15  8:50   ` François Beaulier
2015-05-15  9:11   ` Marc Kleine-Budde
2015-05-15  9:33     ` François Beaulier
2015-05-15 10:24       ` Andri Yngvason
2015-05-15 12:40         ` François Beaulier
2015-05-15 12:47           ` Marc Kleine-Budde
2015-05-15 13:04             ` AW: [BULK]Re: " Uwe Wilhelm (PEAK-System)
2015-05-15 13:17               ` Marc Kleine-Budde
2015-05-15 13:20                 ` AW: " Uwe Wilhelm (PEAK-System)
2015-05-15 14:18               ` François Beaulier
2015-05-15 12:38       ` Gerhard Uttenthaler
2015-05-15 12:48         ` Marc Kleine-Budde
2015-05-15 13:54 ` Bernd Krumboeck
2015-05-18  9:07   ` François Beaulier
2015-05-18 13:31     ` Bernd Krumboeck
2015-05-20 11:35       ` Gediminas Simanskis
2015-05-21  3:19         ` Bernd Krumboeck
2015-05-15 15:24 ` Tom Evans
2015-05-18  9:25   ` François Beaulier
2015-05-18  9:40     ` Gerhard Bertelsmann
2015-05-18 11:13       ` François Beaulier
2015-05-18 12:56       ` Tom Evans

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.