Difference between revisions of "CM-T3517: Linux: Debian"

From Compulab Mediawiki
Jump to: navigation, search
(Software Management)
 
(Socket CAN utilities)
Line 83: Line 83:
 
if [ ! -d /mnt/mmcblk0p1 ]; then mkdir /mnt/mmcblk0p1; fi
 
if [ ! -d /mnt/mmcblk0p1 ]; then mkdir /mnt/mmcblk0p1; fi
 
mount /dev/mmcblk0p1 /mnt/mmcblk0p1
 
mount /dev/mmcblk0p1 /mnt/mmcblk0p1
 +
</pre>
 +
 +
== Device support details ==
 +
=== Basic platform support ===
 +
The CM-T3517 basic platform support is implemented in the {{filename|arch/arm/mach-omap2/board-cm-t3517.c}} file of Linux kernel source tree. This file includes default setup of multi-functional pins, registration of the devices integrated in the CM-T3517 module and definitions of platform-specific configuration for these devices.
 +
 +
=== Controller–area network (CAN) ===
 +
The CM-T3517 features a TI High End CAN Controller (HECC), integrated into the Sitara AM3517/05 SoC. The TI HECC implements full CAN protocol version 2.0B. It supports both the base (standard) and the extended frame format as well as a programmable data bit rate with maximum of 1Mbit/s.
 +
 +
===== Loading CAN modules =====
 +
If TI HECC driver and/or Raw CAN protocol compiled as module(s), they must be loaded prior to enabling CAN interface.
 +
 +
Load Raw CAN protocol module:
 +
<pre>
 +
root@cm-debian:~# modprobe can-raw
 +
can: controller area network core (rev 20090105 abi 8)
 +
NET: Registered protocol family 29
 +
can: raw protocol (rev 20090105)
 +
root@cm-debian:~#
 +
</pre>
 +
Load TI HECC driver module:
 +
<pre>
 +
root@cm-debian:~# modprobe ti_hecc
 +
CAN device driver interface
 +
TI High End CAN Controller Driver 0.7
 +
ti_hecc ti_hecc.1: device registered (reg_base=d0a08000, irq=24)
 +
root@cm-debian:~#
 +
</pre>
 +
 +
For information on enabling CAN kernel support, please, see [[CM-T3517: Linux: Kernel#Controller-area network (CAN) support|Controller-area network (CAN) support]] page.
 +
 +
===== CAN interface configuration =====
 +
It is recommended configure the CAN interface, with the {{filename|iproute2}} utilities. To make sure the right {{filename|ip}} utility is used, run:
 +
<pre>
 +
root@cm-debian:~# ip -V
 +
ip utility, iproute2-ss100224
 +
root@cm-debian:~#
 +
</pre>
 +
 +
Configure CAN interface bit-rate to 125 Kbits/sec (values of up to 1Mbit/sec are supported):
 +
<pre>
 +
root@cm-debian:~# ip link set can0 type can bitrate 125000
 +
root@cm-debian:~#
 +
</pre>
 +
 +
Enable CAN interface:
 +
<pre>
 +
root@cm-debian:~# ip link set can0 up
 +
ti_hecc ti_hecc.1: setting CANBTC=0xc0028
 +
root@cm-debian:~#
 +
</pre>
 +
 +
===== Socket CAN utilities =====
 +
The [http://developer.berlios.de/projects/socketcan/ BerliOS Socket CAN] package is an implementation of CAN protocols for Linux. It uses the Berkeley socket API, the Linux network stack and implements the CAN device drivers as network interfaces. In addition, the package provides user space utilities and test programs suggested as a reference for CAN interface evaluation and testing. The {{filename|socketCAN}} package is available for downloading using SVN or HTTP protocols from the [http://developer.berlios.de/svn/?group_id=6475 BerliOS Socket CAN SVN repository] website.
 +
Download the package and compile {{filename|can-utils}} directory using an appropriate cross-compiler. For information on cross tool-chain, please read [[CM-T3517: Linux: Kernel#Cross-Compiler|Cross-Compiler]] chapter. After the build process is complete, copy the application binaries to the CM-T3517 file system (e.g. {{filename|/usr/local/can-utils/}}).
 +
Use {{filename|cansend}} and {{filename|candump}} utilities to send and receive packets via CAN interface.
 +
 +
Send standard CAN frame (on the first device):
 +
<pre>
 +
root@cm-debian:/# cd /usr/local/can-utils/
 +
root@cm-debian:/usr/local/can-utils# ./cansend can0 111#1122334455667788
 +
root@cm-debian:/usr/local/can-utils#
 +
</pre>
 +
Send extended CAN frame (on the first device):
 +
<pre>
 +
root@cm-debian:/usr/local/can-utils# ./cansend can0 11111111#1122334455667788
 +
root@cm-debian:/usr/local/can-utils#
 +
</pre>
 +
Dump all received data frames as well as error frames (on the second device):
 +
<pre>
 +
root@cm-debian:/usr/local/can-utils# ./candump any,0:0,#FFFFFFFF
 +
  can0  111  [8] 11 22 33 44 55 66 77 88
 +
  can0  11111111  [8] 11 22 33 44 55 66 77 88
 
</pre>
 
</pre>
  

Revision as of 12:35, 12 April 2011

Overview

The example run-time Linux filesystem image for CM-T3517 is based on Debian GNU/Linux Sid. The CompuLab Linux package for CM-T3517 includes ready to run NAND flash image, Linux kernel configuration and source code patches and an archive of the root filesystem, used to create the image.

The default Debian Sid Linux image takes approximately 170 megabytes of flash space, and includes more than 400 software packages. Among them:

  • Core system
  • Debian package management system
  • X11 Windowing System
  • Fluxbox desktop manager
  • Netsurf web browser
  • Samba connectivity suite
  • SSH and FTP server and client

The Getting started with Linux on CM-T3517 page provides a brief introduction on how to install the run-time Linux image. This article describes package structure and peripheral device options specific to the CM-T3517.

CM-T3517 specific settings

Connection and Logging In

Use the following usernames and passwords to login:

Account with administrative privileges:

User: root
Password: 111111

Regular user account:

User: user	
Password: 111111

In addition to these accounts CM-T3517 allows anonymous FTP access. To login into the Linux system, you may use a serial console (ttyS2) at 115200 bps, or connect through the network, or use a keyboard and DVI/LCD display (tty1, tty2, tty3).

Networking

To configure networking, edit /etc/network/interfaces, /etc/udev/rules.d/70-persistent-net.rules, /etc/resolv.conf, /etc/hostname and /etc/hosts. For more information about Debian Linux network configuration read Network setup chapter in the Debian Reference.

Consoles

Linux file system image is designed to suit different kernel versions and configurations. Therefore, during the operating system startup, consoles at several serial ports and DVI display are enabled. Some of these devices may not be supported, either because of kernel versions incompatibilities, or because the kernel was not configured to support these devices. When the console is enabled for such a device, the following or similar message can appear on active console:

INIT: Id "T0" respawning too fast: disabled for 5 minutes

This is not an error message, it is just a warning that can be eliminated by editing /etc/inittab file.

X Windows system

CompuLab distribution contains full featured X Windows system with Fluxbox window manager. Before starting X Windows, connect USB mouse and keyboard to the system. You can run X Windows by typing startx.

Audio

CM-T3517 uses the TLV320AIC23B (TI) audio codec. The audio drivers are modularized if you use default CM-T3517 configuration. To automatically load the audio driver on Linux boot, "snd-soc-cm-t3517" has to be added to the /etc/modules. If the audio driver is not loaded, the following command will load the audio driver and enable audio support:

modprobe snd-soc-cm-t3517

More information about Linux audio subsystem can be found at ALSA project official website.

Touchscreen

CM-T3517 uses the TSC2046 (TI) touchscreen controller. The touchscreen driver is modularized if you use default CM-T3517 configuration and is loaded by udev automatically on Linux boot. If the touchscreen driver is not loaded, the following command will load the touchscreen driver:

modprobe ads7846

The X Windows system of CM-T3517 uses tslib X server input driver to get the input from the touchscreen.

Touchscreen calibration

Touchscreen calibration can be performed with ts_calibrate utility available in package libts-bin. To calibrate the touchscreen:

  • Make sure X Server is not running
  • Make sure the touchscreen driver is loaded as described in Touchscreen section
  • Set the TSLIB_TSDEVICE system variable:
export TSLIB_TSDEVICE=/dev/input/by-path/platform-omap2_mcspi.1-event
  • Run ts_calibrate utility. For proper calibration you are required to touch the touchscreen corners and center in the following order: top-left, top-right, bottom-right, bottom-left, center. The calibration results are saved to file /etc/pointercal.
  • Use ts_test utility to test the calibration results.

MMC/SD

The support for MMC/SD card on CM-T3517 is built into the Linux kernel. To mount the memory card, monitor /proc/partitions to see what partitions were detected on the MMC/SD card. For example, suppose MMC/SD partition you'd like to mount is mmcblk0p1 then:

if [ ! -d /mnt/mmcblk0p1 ]; then mkdir /mnt/mmcblk0p1; fi
mount /dev/mmcblk0p1 /mnt/mmcblk0p1

Device support details

Basic platform support

The CM-T3517 basic platform support is implemented in the arch/arm/mach-omap2/board-cm-t3517.c file of Linux kernel source tree. This file includes default setup of multi-functional pins, registration of the devices integrated in the CM-T3517 module and definitions of platform-specific configuration for these devices.

Controller–area network (CAN)

The CM-T3517 features a TI High End CAN Controller (HECC), integrated into the Sitara AM3517/05 SoC. The TI HECC implements full CAN protocol version 2.0B. It supports both the base (standard) and the extended frame format as well as a programmable data bit rate with maximum of 1Mbit/s.

Loading CAN modules

If TI HECC driver and/or Raw CAN protocol compiled as module(s), they must be loaded prior to enabling CAN interface.

Load Raw CAN protocol module:

root@cm-debian:~# modprobe can-raw
can: controller area network core (rev 20090105 abi 8)
NET: Registered protocol family 29
can: raw protocol (rev 20090105)
root@cm-debian:~#

Load TI HECC driver module:

root@cm-debian:~# modprobe ti_hecc
CAN device driver interface
TI High End CAN Controller Driver 0.7
ti_hecc ti_hecc.1: device registered (reg_base=d0a08000, irq=24)
root@cm-debian:~#

For information on enabling CAN kernel support, please, see Controller-area network (CAN) support page.

CAN interface configuration

It is recommended configure the CAN interface, with the iproute2 utilities. To make sure the right ip utility is used, run:

root@cm-debian:~# ip -V
ip utility, iproute2-ss100224
root@cm-debian:~#

Configure CAN interface bit-rate to 125 Kbits/sec (values of up to 1Mbit/sec are supported):

root@cm-debian:~# ip link set can0 type can bitrate 125000
root@cm-debian:~#

Enable CAN interface:

root@cm-debian:~# ip link set can0 up
ti_hecc ti_hecc.1: setting CANBTC=0xc0028
root@cm-debian:~#
Socket CAN utilities

The BerliOS Socket CAN package is an implementation of CAN protocols for Linux. It uses the Berkeley socket API, the Linux network stack and implements the CAN device drivers as network interfaces. In addition, the package provides user space utilities and test programs suggested as a reference for CAN interface evaluation and testing. The socketCAN package is available for downloading using SVN or HTTP protocols from the BerliOS Socket CAN SVN repository website. Download the package and compile can-utils directory using an appropriate cross-compiler. For information on cross tool-chain, please read Cross-Compiler chapter. After the build process is complete, copy the application binaries to the CM-T3517 file system (e.g. /usr/local/can-utils/). Use cansend and candump utilities to send and receive packets via CAN interface.

Send standard CAN frame (on the first device):

root@cm-debian:/# cd /usr/local/can-utils/
root@cm-debian:/usr/local/can-utils# ./cansend can0 111#1122334455667788
root@cm-debian:/usr/local/can-utils# 

Send extended CAN frame (on the first device):

root@cm-debian:/usr/local/can-utils# ./cansend can0 11111111#1122334455667788
root@cm-debian:/usr/local/can-utils# 

Dump all received data frames as well as error frames (on the second device):

root@cm-debian:/usr/local/can-utils# ./candump any,0:0,#FFFFFFFF
  can0  111  [8] 11 22 33 44 55 66 77 88
  can0  11111111  [8] 11 22 33 44 55 66 77 88

Software Management

Debian Linux image for CM-T3517 includes all the information required to use Debian package management utilities. You can use apt-get and dpkg out of the box.

See also