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

From Compulab Mediawiki
Jump to: navigation, search
(Wireless lan support)
(X Windows system)
 
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
The example run-time Linux filesystem image for CM-X300 is based on Debian GNU/Linux Sid. The CompuLab Linux package for CM-X300 includes ready to run NAND flash image, archive of the root filesystem used to create the image and Linux kernel configuration and source code patches.
+
The example run-time Linux filesystem image for CM-X300 is based on Debian GNU/Linux Sid. The CompuLab Linux package for CM-X300 includes ready to run NAND flash image, Linux kernel configuration and source code patches, and an archive of the root filesystem the UBI image was created from.
 
 
The default Debian Sid Linux image takes approximately 170 megabytes of flash space, and includes more than 400 software packages. Among them:
 
  
 +
The default Debian Sid Linux image includes more than 400 software packages. Among them:
 
* Core system
 
* Core system
 
* Debian package management system
 
* Debian package management system
 
* X11 Windowing System
 
* X11 Windowing System
* Enlightment E17 desktop manager
+
* Enlightenment desktop manager
 
* Netsurf web browser
 
* Netsurf web browser
 
* Samba connectivity suite
 
* Samba connectivity suite
 
* SSH and FTP server and client
 
* SSH and FTP server and client
 +
* ALSA configuration and usage utilities
 +
* Bluetooth tools and daemons
  
The [[CM-X300: Linux: Getting started|Getting started with Linux on CM-X300]] 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-X300.
+
The [[CM-X300: Linux: Getting started|Getting started with Linux on CM-X300]] 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-X300.
  
 
== CM-X300 specific settings ==
 
== CM-X300 specific settings ==
Line 44: Line 46:
  
 
=== X Windows system ===
 
=== X Windows system ===
CompuLab distribution contains full featured X Windows system with Enlightment window manager.
+
CompuLab package contains full featured X Windows system with Enlightment window manager.
 
Before starting X Windows, connect USB mouse and keyboard to the system.
 
Before starting X Windows, connect USB mouse and keyboard to the system.
 
You can run X Windows by typing '''''startx'''''.
 
You can run X Windows by typing '''''startx'''''.
Line 51: Line 53:
 
CM-X300 uses WM9715 (Wolfson) AC97 codec with integrated touchscreen controller.
 
CM-X300 uses WM9715 (Wolfson) AC97 codec with integrated touchscreen controller.
 
Both audio and touchscreen drivers are modularized if you use default CM-X300 configuration.
 
Both audio and touchscreen drivers are modularized if you use default CM-X300 configuration.
The following commands enable audio support and touchscreen support respectively:
+
The following commands enable audio support:
 
<pre>
 
<pre>
 
modprobe snd-soc-em-x270
 
modprobe snd-soc-em-x270
 +
modprobe snd-soc-wm9712
 +
modprobe snd-soc-pxa2xx
 +
</pre>
 +
The following command enables touchscreen support:
 +
<pre>
 
modprobe wm97xx-ts
 
modprobe wm97xx-ts
 
</pre>
 
</pre>
Line 88: Line 95:
 
CompuLab Debian Linux package supports wireless LAN on CM-X300 modules.
 
CompuLab Debian Linux package supports wireless LAN on CM-X300 modules.
  
To enable Wireless LAN interface type:
+
The firmware for the wireless LAN controller is included in the filesystem image and can be found at {{filename|/lib/firmware}} directory.
<pre>
 
modprobe libertas_sdio
 
</pre>
 
 
 
The firmware for the wireless LAN controller is included in the Debian Linux image and can be found at {{filename|/lib/firmware}} directory.
 
  
 
To setup wireless LAN parameters, standard Linux [http://linux.die.net/man/8/ifconfig ifconfig], [http://linux.die.net/man/8/iwconfig iwconfig], [http://linux.die.net/man/8/iwlist iwlist] and [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant] utilities can be used.
 
To setup wireless LAN parameters, standard Linux [http://linux.die.net/man/8/ifconfig ifconfig], [http://linux.die.net/man/8/iwconfig iwconfig], [http://linux.die.net/man/8/iwlist iwlist] and [http://linux.die.net/man/8/wpa_supplicant wpa_supplicant] utilities can be used.
Line 104: Line 106:
  
 
=== MMC/SD ===
 
=== MMC/SD ===
The support for MMC/SD card on CM-X300 is available as loadable kernel module. You need to
+
To mount the memory card, monitor ''/proc/partitions'' to see what partitions were detected on the MMC/SD card. Next, if there's an appropriate device node in ''/dev'', you can directly mount it; otherwise you should create the device node first. For example, suppose the MMC/SD partition you want to mount is ''mmcblk0p1'', then use the following command:
 
 
<pre>
 
modprobe mmc_block
 
modprobe pxamci
 
</pre>
 
 
 
to enable these drivers.
 
 
 
Afterwards, to mount the memory card, monitor ''/proc/partitions'' to see what partitions were detected on the MMC/SD card. Next, if there's approptiate device node in ''/dev'', you can directly mount it, otherwise you should create the device node first. For example, suppose MMC/SD partition you'like to mount is ''mmcblk0p1'' then:
 
  
 
<pre>
 
<pre>
Line 119: Line 112:
 
mount /dev/mmcblk0p1 /mnt/mmc
 
mount /dev/mmcblk0p1 /mnt/mmc
 
</pre>
 
</pre>
 +
 +
== Keypad ==
 +
The demo keypad that is provided in the evaluation kit can be interfaced with via the /dev/input/event0 device file.
  
 
== Software Management ==
 
== Software Management ==
  
Debian Linux for CM-X300 image includes all the information required to use Debian package management utilities. You can use [http://linux.die.net/man/8/apt-get apt-get] and [http://www.wlug.org.nz/dpkg(8) dpkg] out of the box.
+
Debian Linux for CM-X300 image includes all the information required to use Debian package management utilities.
 +
You can use [http://linux.die.net/man/8/apt-get apt-get] and [http://manpages.ubuntu.com/manpages/lucid/man1/dpkg.1.html dpkg] out of the box.
  
 
== Boot time optimization for JFFS2 users ==
 
== Boot time optimization for JFFS2 users ==
Line 132: Line 129:
  
 
Another reason for slow boot is Debian configuration. We tried to make the Debian image for CM-X300 as generic as possible. Therefore it contains a lot of services that may not be required for your application. Removing the unneeded services will reduce the boot time. Also, we have not modified default Debian scripts to allow better system updatability. Because of it, one of the init scripts remounts and checks the root file system several times. You can amend /etc/init.d/checkroot.sh to skip root filesystem remounts and checks.
 
Another reason for slow boot is Debian configuration. We tried to make the Debian image for CM-X300 as generic as possible. Therefore it contains a lot of services that may not be required for your application. Removing the unneeded services will reduce the boot time. Also, we have not modified default Debian scripts to allow better system updatability. Because of it, one of the init scripts remounts and checks the root file system several times. You can amend /etc/init.d/checkroot.sh to skip root filesystem remounts and checks.
 
  
  

Latest revision as of 13:47, 29 September 2013

Overview

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

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
  • Bluetooth tools and daemons

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

CM-X300 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-X300 allows anonymous FTP access. To login into the Linux system, you may use a serial console (ttyS2) at 38400 bps, or connect through the network, or use a keyboard and LCD display (tty1, tty2, tty3).

Networking

To configure networking, edit /etc/network/interfaces, /etc/resolv.conf, and /etc/hostname. For more information about Debian Linux network configuration read Network configuration 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 VGA 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 at such device the following or similar message will 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 package contains full featured X Windows system with Enlightment window manager. Before starting X Windows, connect USB mouse and keyboard to the system. You can run X Windows by typing startx.

Audio and Touchscreen

CM-X300 uses WM9715 (Wolfson) AC97 codec with integrated touchscreen controller. Both audio and touchscreen drivers are modularized if you use default CM-X300 configuration. The following commands enable audio support:

modprobe snd-soc-em-x270
modprobe snd-soc-wm9712
modprobe snd-soc-pxa2xx

The following command enables touchscreen support:

modprobe wm97xx-ts

Enabling touchscreen driver without AC97 controller driver is meaningless, since wm97xx-ts driver uses AC97 bus to access the touchscreen device.
Note, that the same codec and driver is used on Compulab EM-X270 module. More information about Linux audio subsystem can be found at ALSA project official website.

Touchscreen calibration

Touchscreen calibration can be performed with ts_calibrate utility. To calibrate the touchscreen:

  • Make sure X Server is not running
  • Load touchscreen driver as described in Audio and Touchscreen section
  • Set the TSLIB_TSDEVICE system variable:
cd /sys/class/input
name=""
for tsdir in *; do
    if [ -f $tsdir/name ] ; then
        name=`cat $tsdir/name`
    fi;
    echo $name | grep -i "touchscreen" >& /dev/null
    if [ $? -eq 0 ] ; then
        name=`ls -1 $tsdir | grep event\[0-9\] | grep -v :`
        break;
    fi;
done;
export TSLIB_TSDEVICE=/dev/input/$name
  • 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.

Wireless LAN support

CompuLab Debian Linux package supports wireless LAN on CM-X300 modules.

The firmware for the wireless LAN controller is included in the filesystem image and can be found at /lib/firmware directory.

To setup wireless LAN parameters, standard Linux ifconfig, iwconfig, iwlist and wpa_supplicant utilities can be used.

Typical use of those utilities:

  • Enable the wireless interface (eth1):
    ifconfig eth1 up
  • Check for available access points around:
    iwlist eth1 scan
  • Assign an access point:
    iwconfig eth1 essid "My Network"
  • Get an IP address from the access point:
    dhclient eth1

MMC/SD

To mount the memory card, monitor /proc/partitions to see what partitions were detected on the MMC/SD card. Next, if there's an appropriate device node in /dev, you can directly mount it; otherwise you should create the device node first. For example, suppose the MMC/SD partition you want to mount is mmcblk0p1, then use the following command:

if [ ! -b /dev/mmcblk0p1 ]; then mknod /dev/mmcblk0p1 b 253 1; fi
mount /dev/mmcblk0p1 /mnt/mmc

Keypad

The demo keypad that is provided in the evaluation kit can be interfaced with via the /dev/input/event0 device file.

Software Management

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

Boot time optimization for JFFS2 users

The JFFS2 Debian image for CM-X300 boot takes relatively much time. The delays during the boot are partially related to JFFS2 mount time and partially to Debian image configuration.

JFFS2 designed for robust operation in embedded environment where sudden power interruptions are frequent. As a trade off for reliability in this situations, JFFS2 has long mount time. The mount time scales linearly with flash partition size. To speed up the boot process you can partition the NAND flash so it'll contain relatively small partition holding root filesystem and another partition(s) for applications and data. Mounting of applications and data partitions can be done in the background concurrently with init scripts execution.

Another reason for slow boot is Debian configuration. We tried to make the Debian image for CM-X300 as generic as possible. Therefore it contains a lot of services that may not be required for your application. Removing the unneeded services will reduce the boot time. Also, we have not modified default Debian scripts to allow better system updatability. Because of it, one of the init scripts remounts and checks the root file system several times. You can amend /etc/init.d/checkroot.sh to skip root filesystem remounts and checks.


See also