2253 Toradex: Difference between revisions
No edit summary |
No edit summary |
||
| Line 63: | Line 63: | ||
</pre> | </pre> | ||
The driver is now loaded on the board, and should load automatically whenever the 2253 device is plugged in. You can check "dmesg|tail" to verify the | The driver is now loaded on the board, and should load automatically whenever the 2253 device is plugged in. You can check "dmesg|tail" to verify the driver is loaded and 3 V4L2 "/dev/video" nodes are created. | ||
To run the "demo.py" demonstration program, you will need to install these python packages first: | To run the "demo.py" demonstration program, you will need to install these python packages first: | ||
Revision as of 18:55, 1 December 2015
This page will guide you in using the Sensoray Model 2253 with the Toradex ARM development boards.
You will need a Linux host to cross-compile the driver and demo applications. You will need version 1.2.11 or later of the 2253 Linux SDK. After extracting the SDK, create another directory beside it called "toradex". In the "toradex" directory, create a file called "build.sh" containing the following script:
#!/bin/sh
set -x
DRIVER=`pwd`/../sdk_x53_linux_1.2.11/driver
if [ ! -d linux-toradex ]; then
git clone -b toradex_imx_3.10.17_1.0.0_ga-next --single-branch git://git.toradex.com/linux-toradex.git
fi
if [ ! -d gcc-linaro ]; then
FILE=gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf.tar.xz
if [ ! -f $FILE ]; then
wget http://releases.linaro.org/14.11/components/toolchain/binaries/arm-linux-gnueabihf/$FILE
fi
tar xf $FILE
ln -s gcc-linaro-4.9-2014.11-x86_64_arm-linux-gnueabihf gcc-linaro
fi
export PATH=${PATH}:`pwd`/gcc-linaro/bin
export CROSS_COMPILE=arm-linux-gnueabihf-
export ARCH=arm
cd linux-toradex
if [ x$1 = xclean ]; then
git clean -d -f -x -q
fi
gunzip -c ../config.gz > .config
make oldconfig
make prepare
make scripts
#cp ../Module.symvers.colibri-imx6 Module.symvers
cp ../Module.symvers.apalis-imx6 Module.symvers
KDIR=`pwd`
make -C $KDIR SUBDIRS=$DRIVER clean
make -C $KDIR SUBDIRS=$DRIVER modules
You'll also need to copy a file from the board "/proc/config.gz" to the "toradex" directory. You'll also need "Module.symvers.apalis-imx6" or "Module.symvers.colibri-imx6" from Toradex support.
Now run the script using "sh build.sh" from a terminal in the "toradex" directory.
Now run "make demo_armhf" from a terminal in the "sdk_x53_linux_1.2.11" directory.
Now copy the whole "sdk_x53_linux_1.2.11" directory to the Toradex board, and run the following commands in the terminal (as root)
cd sdk_x53_linux_1.2.11/driver cp s2253.fw /lib/firmware/ mkdir -p /lib/modules/`uname -r`/extra cp s2253.ko /lib/modules/`uname -r`/extra/ depmod -a modprobe s2253
The driver is now loaded on the board, and should load automatically whenever the 2253 device is plugged in. You can check "dmesg|tail" to verify the driver is loaded and 3 V4L2 "/dev/video" nodes are created.
To run the "demo.py" demonstration program, you will need to install these python packages first:
opkg install \
python \
python-pygtk \
python-ctypes \
python-threading \
python-subprocess \
python-mmap
There is no "mplayer2" package, so the "preview" button in the demo will not work.
To record from the terminal, use "./capture" (use -h to see options) or read "README.txt" for examples.