HOME

TheInfoList



OR:

can4linux is an
Open Source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
CAN Linux-Kernel
device driver In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabling operating systems and o ...
. Development started in the mid-1990s for the Philips 82C200 CAN controller stand alone chip on an ISA Board AT-CAN-MINI. In 1995 the first version was created to use the CAN bus with Linux for laboratory automation as a project of the Linux Lab Project at
FU Berlin The Free University of Berlin (, often abbreviated as FU Berlin or simply FU) is a public research university in Berlin, Germany. It is consistently ranked among Germany's best universities, with particular strengths in political science and t ...
. The increasing spread of the CAN field bus
technology Technology is the application of knowledge to reach practical goals in a specifiable and reproducible way. The word ''technology'' may also mean the product of such an endeavor. The use of technology is widely prevalent in medicine, scie ...
for automation especially in
embedded Embedded or embedding (alternatively imbedded or imbedding) may refer to: Science * Embedding, in mathematics, one instance of some mathematical object contained within another instance ** Graph embedding * Embedded generation, a distributed ge ...
devices and the growth of Linux in this area leads to a growing importance of device drivers as base for higher layer CAN protocols like
CANopen CANopen is a communication protocol and device profile specification for embedded systems used in automation. In terms of the OSI model, CANopen implements the layers above and including the network layer. The CANopen standard consists of an addre ...
,
J1939 Society of Automotive Engineers standard SAE J1939 is the vehicle bus recommended practice used for communication and diagnostics among vehicle components. Originating in the car and heavy-duty truck industry in the United States, it is now widely ...
and
DeviceNet DeviceNet is a network protocol used in the automation industry to interconnect control devices for data exchange. It utilizes the Common Industrial Protocol over a Controller Area Network media layer and defines an application layer to cover a ran ...
. Besides the NXP SJA1000 as successor of the first supported CAN controller Philips 82C200 and the Intel 82527, the development for powerful
microcontroller A microcontroller (MCU for ''microcontroller unit'', often also MC, UC, or μC) is a small computer on a single VLSI integrated circuit (IC) chip. A microcontroller contains one or more CPUs ( processor cores) along with memory and programma ...
s with integrated CAN controllers that are capable to run the Linux
Operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
have been intensified since 2005. As examples for this development serve Freescale's ColdFire processors or ARM models by ATMEL and Freescale but also the stand-alone CAN controller MCP2515, connected via
SPI SPI may refer to: Organizations * Indian Protection Service (''Serviço de Proteção ao Índio''), Brazil * Shotmed Paper Industries, an Egyptian paper manufacturers * Simulations Publications, Inc., a former US board game publisher * Sony P ...
Bus. A list of supported CAN controllers is available on the can4linux project site. In the latest version there is a ''virtual'' CAN mode implemented which allows applications to communicate without CAN hardware but only by using the device driver
software Software is a set of computer programs and associated software documentation, documentation and data (computing), data. This is in contrast to Computer hardware, hardware, from which the system is built and which actually performs the work. ...
layer. This mode already includes support for the new CAN frame format called CAN FD which allows data frame length up to 64 byte.


Usage

Application software opens a CAN device descriptor and gets back a file descriptor. Using this file descriptor standard operating system functions like read() and write() are used to exchange CAN frames with other CAN nodes on a CAN bus. The following code is an example which puts a CAN frame on the bus and afterwards waits for a CAN frame transmitted by another CAN node. More examples are available on the can4linux project site.Onlin
can4linux-examples
/* simple CAN application example * * used for the Wikipedia article on can4linux */ #include #include #include #include int main(int argc,char **argv) can4linux can be compiled in a way that allows more than one process to have access to the same CAN controller hardware for reading and writing frames on the CAN bus. Beside the real application other processes like data loggers or other diagnosis processes can access the bus.


References

{{reflist


External links


Can4linux Project WebpageLinux System Administrator Roles & Responsibilities
CAN bus Linux software Device drivers Linux drivers Serial buses Data transmission