CM-FX6: Linux: Debian

From Compulab Mediawiki
Revision as of 12:10, 13 March 2013 by Grinberg (talk | contribs) (New page: == Overview == The example run-time Linux filesystem image for CM-FX6 is based on Debian GNU/Linux Sid. The CompuLab Linux package for CM-FX6 includes ready to run NAND flash image, Linux ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Overview

The example run-time Linux filesystem image for CM-FX6 is based on Debian GNU/Linux Sid. The CompuLab Linux package for CM-FX6 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 includes more than 400 software packages. Among them:

  • Core system
  • Debian package management system
  • X11 Windowing System
  • Enlightenment desktop manager
  • Netsurf web browser
  • Samba connectivity suite
  • SSH and FTP server and client
  • ALSA configuration and usage utilities
  • CAN Bus utilities
  • Bluetooth tools and daemons

The Getting started with Linux on CM-FX6 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-FX6.

Package contents

version.txt

The contents of the version.txt identifies the package version.

images

  • uImage-cm-fx6 - ready to run Linux kernel image binary for CM-FX6
  • debian-image.ubi - ready to run Debian Linux UBI image for installation onto the NAND flash
  • debian-image.tar.bz2 - archive of the Debian root file system
  • kernel.img - Kernel image required for installation onto the NAND flash or the SSD
  • ramdisk.img - Ramdisk image required for installation onto the NAND flash or the SSD
  • bootscr.img - U-Boot script used for image installation

kernel

  • uImage-3.0.35-cm-fx6-1.bin - ready to run Linux kernel version 3.0.35-cm-fx6-1 for CM-FX6
  • linux-3.0.35-cm-fx6-1.config - Linux kernel 3.0.35-cm-fx6-1 configuration file
  • linux-3.0.35-cm-fx6-1.patch - patch vs. Linux stable kernel 3.0.35 with support for CM-FX6 peripherals
  • patches - ordered collection of patches, that form the single patch above (linux-3.0.35-cm-fx6-1.patch)

utilities

The utilities directory contains miscellaneous utilities useful for development

  • tftpd32.zip - TFTP server for Windows users
  • eeprom-util - CompuLab EEPROM utility for reading information found inside the EEPROM on CompuLab boards
  • bootscr.src - U-Boot script source used for loading kernel and ramdisk images from MMC/SD card
  • debian-image.cfg - configuration file used by ubinize utility for debian-image.ubi generation. For more information about UBIFS images please refer to the Linux Development for ARM modules article.


Using Debian Linux on CM-FX6

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-FX6 allows anonymous FTP access. To login into the Linux system, you may use a serial console (ttymxc3) at 115200 bps, or connect through the network, or use a keyboard and DVI/LCD/HDMI display (tty1, tty2, tty3, tty4).


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/LCD 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 Enlightenment 17 window manager. Before starting X Windows, connect USB mouse and keyboard to the system. You can run X Windows by typing startx.

Enlightenment 17 window manager has a built in configuration set up to work best with phones, tablets and similar devices. To activate the "touchscreen" profile, enter Main->Settings Panel->Settings->Profiles. Select the Touchscreen profile.

To switch back to the standard profile, please see the Known Issues article.


Software Management

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


HDMI Audio

CM-FX6 provides a digital HDMI audio interface, which is registered as a standard ALSA sound card. If the default CM-FX6 configuration is used, the audio drivers are loaded automatically in the boot process.

Admolition note.png The HDMI audio will work only if the HDMI cable is plugged in.

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


Touchscreen

CM-FX6 Evaluation Kit is equipped with DataImage SCF0403852GGU04 LCD touch panel. See LCD, DVI and HDMI support and Touchscreen support sections for kernel configuration details to enable support for the particular touchscreen. The touchscreen driver is modularized if you use default CM-FX6 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:

  • For TI TSC2046 touch panel:
modprobe ads7846
  • For DataImage SCF0403852GGU04 LCD touch panel (Himax HX8520-C):
modprobe hx8520-c

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

Touchscreen calibration

Both supported touchscreen devices can be accessed through symbolic link /dev/input/touchscreen. The symlink is created by udev rules defined in /etc/udev/rules.d/10-touchscreen.rules.
Calibration utilities require proper setting of TSLIB_TSDEVICE system variable (pointing to the touchscreen device special file). This is done automatically by the /etc/profile.d/tslib.sh script.

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
  • 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-FX6 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


Display options

CM-FX6 evaluation platform can be used with at least three display interfaces: LCD, DVI, and HDMI. Default configuration of Linux kernel and Debian Linux for CM-FX6 uses LCD as primary video output. It is possible to use either the DVI or the LCD interface at the same time. HDMI can be used simultaneously with either LCD or DVI interface.
Linux implementation of the i.MX6 display subsystem (IPU) is described in LCD, DVI and HDMI support section.

In the default Linux configuration for CM-FX6, two main framebuffers are available: /dev/fb0 and /dev/fb2. The default mapping is:

  • LCD/DVI <---> /dev/fb0
  • HDMI <---> /dev/fb2

In order to change the mapping, the following kernel command line parameters can be provided:

  • For DVI on /dev/fb0:
    video=mxcfb0:dev=dvi,1280x800-24M@50,if=RGB24
  • For HDMI on /dev/fb0:
    video=mxcfb0:dev=hdmi,1280x720-24M@50,if=RGB24


GPIO access

Linux provides simple and convenient GPIO access via sysfs interface. A GPIO should be exported using /sys/class/gpio/export. After the GPIO is exported it is possible to change its direction and value using /sys/class/gpio/gpioX/direction and /sys/class/gpio/gpioX/value attributes.

Example

The following example demonstrates how to configure GPIO 140 as output and set value to high:

echo 140 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio140/direction
echo 1 > /sys/class/gpio/gpio140/value
Admolition note.png The above example assumes that the corresponding pin is set to mux mode 5 and the GPIO 140 is not requested in the Linux kernel.


See also