Escolar Documentos
Profissional Documentos
Cultura Documentos
Applications
Mihai Postolache, Gabriel Neamtu, and Sorin Dumitru Trofin
Faculty of Automatic Control and Computer Engineering
Gheorghe Asachi Technical University of Iasi
Iasi, Romania
E-mail: mpostol@ac.tuiasi.ro
AbstractThis paper presents the design and practical
implementation of a gateway interface between two networks,
CAN and Ethernet. Data packets detected over a network will be
routed to the other network, with the possibility of using various
filters. Since there is no standard yet for this purpose, the paper
also proposes a method to pack one or more CAN messages in an
Ethernet frame. For testing purposes of the interface gateway
and its implementation a series of graphical software tools
running on a PC client have been developed. These tools are able
to send and decode messages using the specified packaging. At
the end of the paper a graphical application demonstrates the
functionality of the gateway implementation and the benefits of
the proposed CAN-Ethernet routing method.
I.
INTRODUCTION
422
II.
423
These are the basic functions that underpin the CAN driver.
In addition, a set of functions used for setting buffers to
automatically answer to remote frames was written.
424
Standard
ID
ID LEN ID-MSB
1
4
3
Extended ID LEN
ID
1
4
unused
3
DATA
ID-LSB
8
unused
3
ID-MSB
5
ID-MID1
8
ID-MID2
8
DATA
ID-LSB
8
The read data packet function reads from the received data
buffer memory to download new packages, considering the
overcome of the memory buffer area and return to the base
address.
The send data packet function puts data to be sent in the
transmission memory buffer for the data packet to be sent.
Additional bytes representing transmission options are added
and the transmission is started.
D. Packing and unpacking CAN messages in Ethernet packets
Due to the large differences between packet sizes, schemes
for packing and unpacking several CAN messages in an
Ethernet packet have to be implemented [4], and the method
used is shown in Fig. 6.
Ethernet
Receive
Task
Receive Ethernet
packet
Blocking
wait
Yes
Buffer
empty?
Blocking
wait
No
Unpacking Ethernet
frame
Send CAN messages
Ethernet
Transmit
Task
Blocking
wait
Blocking
wait
Yes
FIFO
empty?
No
Packing CAN
messages
Send Ethernet packet
III.
425
Fig. 9. In-vehicle connection, diagnosis and control using the CAN-Ethernet gateway
426
[2]
[3]
[4]
[5]
[6]
[7]
Due to the much higher transfer rate all the in-vehicle CAN
buses may be simultaneously accessible from outside. Thus, a
diagnostic program designed to check each parameter of all
buses could be useful for both for service stations and even the
car owner through its personal laptop.
Applications to update the firmware are easy to implement,
thus avoiding recall a large number of vehicles in service
stations for software errors. Each manufacturer could make
available on their website the latest firmware, then each client
may download it and update its own car firmware.
One can include one or more internal Ethernet buses to
meet the need for larger packages and high transfer rates
required by new devices. This includes in particular
applications which are uncritical from the safety and reliability
point of view, but where the information flow is high, such as
in the area of information-entertainment (infotainment).
Further work will be done to improve the gateway
implementation using an Ethernet controller with TCP/IP
implemented in hardware so that the memory required by the
TCP/IP stack and the processing time of host controller with
the TCP/IP code execution to decrease.
Also, the gateway firmware may be improved to perform
routing in several CAN bus simultaneously. This is already
enabled in the actual software implementation, but was not
tested in our experiments due to the memory limitations.
One can also change the program to allow connections with
multiple sockets simultaneously and to include the PPPoE
protocols that make possible connection using routers.
Finally, use of communication protocols specific to web
pages could enable access to the CAN network via Internet,
using Ethernet cable or a Wi-Fi protocol.
REFERENCES
[1]
Jang, K., Park, I. Han, J. et al., Design framework for FlexRay network
parameter optimization, International Journal of Automotive
Technology, Vol. 12, issue 4, pp.589-597, 2011
427