Skip to contentSkip to conversation

Linux board with 10 CANs

DISCUSSION François Beaulier 10 participants 24 messages May 15, 2015 – May 21, 2015 CAN network drivers

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 39 lines · 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 ?

Quoted 7 lines

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

#2 lore raw
Quoted 45 lines · Yegor Yefremov
Quoted 44 lines · 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).

Quoted 6 lines
Quoted 2 lines

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

#3 lore raw
In reply to Yegor Yefremov
Quoted 45 lines · Yegor Yefremov
Quoted 44 lines · 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).

Quoted 5 lines
Quoted 2 lines

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

Signature · 4 lines
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   |
#4 lore raw
Quoted 52 lines · Marc Kleine-Budde
Quoted 45 lines · Yegor Yefremov
Quoted 44 lines · 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).

Quoted 4 lines
Quoted 2 lines

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.

Quoted 8 lines

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

#5 lore raw

Quoting François Beaulier (2015-05-15 09:33:30)

Quoted 59 lines · Marc Kleine-Budde
Quoted 58 lines · Yegor Yefremov
Quoted 45 lines · François Beaulier
Quoted 44 lines

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

Quoted 4 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 2 lines

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

#6 lore raw
Quoted 62 lines · Andri Yngvason

Quoting François Beaulier (2015-05-15 09:33:30)

Quoted 61 lines · Marc Kleine-Budde
Quoted 60 lines · Yegor Yefremov
Quoted 45 lines · François Beaulier
Quoted 44 lines

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

Quoted 4 lines
Quoted 2 lines

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

Quoted 8 lines
Quoted 5 lines

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

#12 lore raw
In reply to François Beaulier

Am 15.05.2015 um 11:33 schrieb François Beaulier:

Quoted 65 lines · Marc Kleine-Budde
Quoted 64 lines · Yegor Yefremov
Quoted 50 lines
Quoted 48 lines · 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).

Quoted 4 lines
Quoted 2 lines

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.

Quoted 7 lines
Quoted 2 lines

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

Signature · 8 lines
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
#7 lore raw
In reply to François Beaulier
Quoted 5 lines · François Beaulier
Quoted 3 lines

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.

Quoted 3 lines

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

Signature · 4 lines
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   |
#13 lore raw
In reply to Gerhard Uttenthaler
Quoted 8 lines · Gerhard Uttenthaler
Quoted 4 lines

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

Signature · 4 lines
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   |
#8 lore raw
In reply to Marc Kleine-Budde
Quoted 19 lines

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:linux-can- [email protected]] Im Auftrag von Marc Kleine-Budde
Gesendet: Freitag, 15. Mai 2015 14:47
An: François Beaulier; Andri Yngvason; Yegor Yefremov
Cc: [email protected]
Betreff: [BULK]Re: Linux board with 10 CANs

Quoted 5 lines · François Beaulier
Quoted 3 lines

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.

Quoted 8 lines
Quoted 3 lines

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: [email protected]
Webseite: www.peak-system.com

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

#9 lore raw
Quoted 25 lines · Uwe Wilhelm (PEAK-System)
Quoted 25 lines

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:linux-can- [email protected]] Im Auftrag von Marc Kleine-Budde
Gesendet: Freitag, 15. Mai 2015 14:47
An: François Beaulier; Andri Yngvason; Yegor Yefremov
Cc: [email protected]
Betreff: [BULK]Re: Linux board with 10 CANs

Quoted 5 lines · François Beaulier
Quoted 3 lines

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.

Quoted 3 lines

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.

Quoted 7 lines
Quoted 2 lines

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

Signature · 4 lines
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   |
#10 lore raw
Quoted 38 lines

-----Ursprüngliche Nachricht-----
Von: Marc Kleine-Budde [mailto:[email protected]]
Gesendet: Freitag, 15. Mai 2015 15:18
An: Uwe Wilhelm (PEAK-System); 'François Beaulier'; 'Andri Yngvason'; 'Yegor Yefremov'
Cc: [email protected]
Betreff: Re: AW: [BULK]Re: Linux board with 10 CANs

Quoted 28 lines · Uwe Wilhelm (PEAK-System)
Quoted 27 lines

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:linux-can- [email protected]] Im Auftrag von Marc Kleine-Budde
Gesendet: Freitag, 15. Mai 2015 14:47
An: François Beaulier; Andri Yngvason; Yegor Yefremov
Cc: [email protected]
Betreff: [BULK]Re: Linux board with 10 CANs

Quoted 5 lines · François Beaulier
Quoted 3 lines

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.

Quoted 3 lines

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

Quoted 7 lines
Quoted 5 lines

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

#14 lore raw
In reply to François Beaulier

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:

Quoted 31 lines

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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#11 lore raw
In reply to Uwe Wilhelm (PEAK-System)
Quoted 22 lines · Uwe Wilhelm (PEAK-System)
Quoted 22 lines

-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:linux-can- [email protected]] Im Auftrag von Marc Kleine-Budde
Gesendet: Freitag, 15. Mai 2015 14:47
An: François Beaulier; Andri Yngvason; Yegor Yefremov
Cc: [email protected]
Betreff: [BULK]Re: Linux board with 10 CANs

Quoted 5 lines · François Beaulier
Quoted 3 lines

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.

Quoted 3 lines

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.

Quoted 8 lines
Quoted 2 lines

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

#19 lore raw
In reply to François Beaulier
Quoted 4 lines · 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.

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

Quoted 1 line

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.

Quoted 4 lines

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

#15 lore raw
In reply to Bernd Krumboeck
Quoted 16 lines · Bernd Krumboeck

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

Quoted 8 lines

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

Quoted 38 lines

Am 2015-05-15 um 09:56 schrieb François Beaulier:

Quoted 34 lines

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

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
#20 lore raw
In reply to Tom Evans

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

Quoted 30 lines · Tom Evans
Quoted 4 lines · 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.

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

Quoted 1 line

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.

Quoted 4 lines

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

#21 lore raw

Hi Francois,
Am Mo, 18.05.2015, 11:25, schrieb François Beaulier:

Quoted 8 lines

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

#22 lore raw
Quoted 19 lines · Gerhard Bertelsmann

Hi Francois,
Am Mo, 18.05.2015, 11:25, schrieb François Beaulier:

Quoted 8 lines

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

Quoted 8 lines

Regards

Gerd

--
To unsubscribe from this list: send the line "unsubscribe linux-can" in the body of a message to [email protected]
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

#23 lore raw
In reply to Gerhard Bertelsmann
Quoted 4 lines · Gerhard Bertelsmann

Hi Francois,
Am Mo, 18.05.2015, 11:25, schrieb François Beaulier:

Quoted 2 lines

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.

Quoted 1 line
Quoted 1 line

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.

Quoted 2 lines
Quoted 2 lines

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.

Quoted 2 lines

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

#16 lore raw
In reply to François Beaulier

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:

Quoted 75 lines · Bernd Krumboeck
Quoted 16 lines

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

Quoted 8 lines

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

Quoted 35 lines

Am 2015-05-15 um 09:56 schrieb François Beaulier:

Quoted 31 lines

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 [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#17 lore raw

Hi,
GPL2
Gediminas

Quoted 90 lines · Bernd Krumboeck

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:

Quoted 78 lines · Bernd Krumboeck
Quoted 16 lines

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

Quoted 8 lines

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

Quoted 38 lines

Am 2015-05-15 um 09:56 schrieb François Beaulier:

Quoted 34 lines

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

Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
To unsubscribe from this list: send the line "unsubscribe linux-can" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
#18 lore raw

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:

Quoted 97 lines

Hi,
GPL2
Gediminas

Quoted 87 lines · Bernd Krumboeck

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:

Quoted 75 lines · Bernd Krumboeck
Quoted 16 lines

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

Quoted 8 lines

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

Quoted 35 lines

Am 2015-05-15 um 09:56 schrieb François Beaulier:

Quoted 31 lines

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 [email protected]
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 [email protected]
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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html