<<< Previous topic - Next topic >>> |
|
Author |
Message |
kdw
Joined: 05 May 2006 Posts: 1460
|
Posted: 25.01.2010, 11:19 Post subject: SJA1000 CAN Treiber … |
|
|
Hallo Forum.
Für den Betrieb eines SJA1000 am DNP/2486 gibt es von uns CAN4Linux-Treiber:
Code: | Build and install CAN4Linux driver in DNP/2486, eSOM/2586 or OTP/57V
====================================================================
Table of contens:
Building from source
Manual installing and testing driver on target system
Installing Debian packtes
Preamble
--------
This driver can use for DNP/2486, eSOM/2586 and OTP/57V. The IO-port depends on the used chip select and INT-pin, please refer the hardware manual (CS1=100h/101h, INT3=IRQ7).
Building from source
--------------------
Before you can build this module, needs to extract and configure the Linux kernel source, that currently is running in the DIL/NetPC. Please remember, that must use the same gcc (4.1.2), that was used for the running kernel. Typically you would do such steps:
# Setup for Cross building (optional)
export PATH=$HOME/linux/gcc-4.1.2/bin:$PATH
mkdir $HOME/DNP2486/kernel
cd $HOME/DNP2486/kernel
tar xzf linux-2.6.18.8-dmp-ssv1.tar.gz
cd linux-2.6.18.8-dmp-ssv1
#patch -p1 < dnp2486-4uart.patch # patch optional changes
cp CONFIG-DNP2486-2.6.18.8-SSV20080404 .config
make oldconfig
make bzImage
Extract the CAN driver source:
cd $HOME
tar xzf can4linux-3.4.6-SSV20090513.tgz
cd can4linux
Than build the CAN module. This is a typically build script
(please adjust your paths):
# Setup for Cross building (optional)
export PATH=$HOME/linux/gcc-4.1.2/bin:$PATH
# Check compiler version
if [ `gcc -dumpversion` != "4.1.2" ]
then
echo "wrong GCC version, or path not set!" >&2
exit 1
fi
# KERNEL_SRC: Please adjust this path before using!
KERNEL_DIR="$HOME/DNP2486/kernel/linux-2.6.18.8-dmp-ssv1"
# Build Kernel module
make -C $KERNEL_DIR M=$PWD TARGET="DNP2486" LINUXTARGET="dnp2486"
Build the examples:
tar xzf can4linux-examples-SSV20090513.tgz
cd can4linux-examples
# Setup for Cross building (optional)
export PATH=$HOME/linux/gcc-4.1.2/bin:$PATH
make CC=gcc
Manual installing and testing driver on target system
-----------------------------------------------------
All drivers and example programs are pre build in ZIP file can4linux-dnp2486-ssv20090119.zip, you can use these files without compiling.
Copy device driver file "can.ko" into DIL/NetPC. Load the module in DIL/NetPC and create device node:
insmod can.ko
mknod /dev/can0 c 91 0
chmod 0766 /dev/can0
Configure CAN driver:
./cansetup-single ssv_dnp2486.conf
Copy examples "transmit" and "receive" to DIL/NetPC, setup baudrate and run the examples:
echo "20" >/proc/sys/Can/Baud
./transmit can0
./receive can0
Installing Debian packtes
-------------------------
SSV provides two debian pakets with prebuild CAN drivers and example files.
Installing the package:
Copy packets
can4linux-3.4.6-*_esom2586.deb and
can4linux_examples-3.4.6-*_esom2586.deb
into directory /tmp,
login as root and run the packet installer for driver and examples.
# dpkg --install /tmp/can4linux-3.4.6-*_esom2586.deb
# dpkg --install /tmp/can4linux_examples-3.4.6-*_esom2586.deb
To view the exist packets for CAN type this command:
# dpkg --list 'can4linux*'
Please adjust the baudrate in the file /etc/can.conf and run
# dpkg-reconfigure can4linux
All examples are installed in directory /usr/local/bin/can, please refer source code and inline help for using the files. Typically you would run:
# export PATH=$PATH:/usr/local/bin/can
# transmit
# receive
# can_send --help
Remove the packages:
# dpkg --purge can4linux-examples
# dpkg --purge can4linux
|
Gruß
KDW |
|
Back to top |
|
|
kdw
Joined: 05 May 2006 Posts: 1460
|
Posted: 02.02.2010, 17:13 Post subject: SJA1000 … |
|
|
Hallo Forum.
Selbst verständlich können wir auch ein Schaltbild zur Anbindung eines SJA1000 an den DNP/2486 zur Verfügung stellen. Bei Interesse bitte eine E-Mail an sales@ssv-embeddede.de senden.
Gruß
KDW |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|