Beruflich Dokumente
Kultur Dokumente
Introduction
References
To bring up CAN interface, refer to following links:
http://e2e.ti.com/support/dsp/sitara_arm174_microprocessors/f/791/t/1545
60.asx
http://processors.wiki.ti.com/index.php/AM335X_DCAN_Driver_Guide#CAN_Ut
ilities
pkgs.fedoraproject.org/repo/pkgs/iproute
/iproute2-2.6.39.tar.gz/8a3b6bc77c2ecf752284aa4a6fc630a6/iprout
e2-2.6.39.tar.gz
www.pengutronix.de/software/libsocketcan/download/libsocketcan-0
.0.8.tar.bz2
http://www.pengutronix.de/software/socket-can/download/canutils/
v4.0/
OBJECTIVE
Implementation plan
Hardware setup
Hardware setup
contd
Networking options -
[ ] Amateur Radio support -
<*>Can bus system support -
IRDA (infrared) subsystem support -
.
9
After building the kernel, to test and use the CAN interfaces, CAN
utilities were deployed.
We followed the below link for building CAN utilities:
http://processors.wiki.ti.com/index.php/AM335X_DCAN_Driver_Guide#CAN_Utilities
To configure the CAN interface, net link standard utilities are used
and this requires iproute2 utilities. The following procedures have
been carried out to build iproute2 , libsocketcan and CAN-utils with
the help of above link.
Note : All the three packages have been configured under the same
directory .
11
Ip cross compilation:
Modifications :
Makefile modifications are needed for cross compiling the source for ARM .
Inside a Makefile,
Commented these variables from top Makefile , and set appropriate
environment
variables for building.
DESTDIR
DBM_INCLUDE
CC
Note: Do not build arpd
On console, under iproute2 src directory,
$ cp misc/Makefile{,.orig}
$ sed '/^TARGETS/s@arpd@@g' misc/Makefile.orig > misc/Makefile
12
( <Path to
export
export
export
export
CROSS_COMPILE_PREFIX=$PREFIX
DBM_INCLUDE=/usr/include
INCLUDES=/usr/include
DESTDIR=${PREFIX}/
13
Configuration:
$ ./configure --host=arm-arago-linux --prefix=$PREFIX
--enable-debug
Environment Variables:
Using the same environment variables compiled for
iproute2 .
Configuration:
$
./configure
--host=arm-arago-linux
--prefix=$PREFIX
--enable-debug
Configuration:
$ ./configure --host=arm-arago-linux --prefix=$PREFIX --enabledebug
Then, the built libraries and binaries are taken to the /lib
and /sbin directory of root-file system of Beagle bone.
18
After building the kernel and root-file system with CAN utilities, we
proceeded with the following steps to test the CAN interface on
Beaglebone board with the hardware setup we have mentioned it
before(slide 5) .
On board,
First ,we need to configure and start both the CAN interfaces,
can0 and can1, using CANutils :
$
$
$
$
canconfig
canconfig
canconfig
canconfig
can0
can0
can1
can1
Note:
1. A command ifconfig is used to check for device interfaces up on Beagle bone
2. The usage of CAN utils executables can be known in detail by using a command
--help after CAN utils executable (e.g. cansend --help).
19
Debugging support
Basic debugging:
User can test the addition of CAN interfaces in kernel by viewing
the devices in the target system under the network device
directory.
This can be done using the command cat /proc/net/dev/ on
terminal, which should give following output.
# cat /proc/net/dev
Inter-| Receive
| Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo
colls carrier compressed
lo 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
can1
8
1
0
0
0
0
0
0
0
0
0
0
0
0
0
can0
0
0
0
0
0
0
0
0
8
1
0
0
0
0
0
eth0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
If the devices are not seen in this directory , then kernel source
code must be checked for proper initialization and configuration.
Debugging support
contd..,
Once the devices are shown in the kernel, the CAN-utils executables
can be used for setting up IP network over the CAN driver. This is
done by executing canconfig command as mentioned in slide 19.
The availability CAN as network interface can be checked with
ifconfig command on terminal as shown below:
can0
can1
00-0
Debugging support
contd..,
Debugging support
contd.,
Conclusion
26
Thank-you for
your time