uClinux (pronounced u-see Linux) is an MMU-less version of the Linux operating system. With the advent of the 2.6 kernel, it is supported directly by the Linux kernel tree, although realistically most are patched to keep up the development.
The EMAC distribution is based on the uClinux-dist-20051110.tar.gz build (the latest stable build at the time of this writing).
The EMAC SoM-5282M uClinux distribution is freely available to customers in one of two forms
SoM-5282M’s are always shipped with the latest version resident in flash.
EMAC also provides an RTAI port to the old 2.4 distribution, which can be downloaded from the ftp site in source or pre-built form.
Here is a list of some of the pre-integrated features of EMAC uClinux distribution that are part of the core uClinux distribution.
This is, of course, not a complete list of programs the distribution offers, but is meant to point out some of the features currently offered. The EMAC uClinux distribution provides a clean build environment for adding additional programs as well, many times is simply a matter of checking something you want from the list.
In addition to the features offered by the standard uClinux build, at the time of this writing, EMAC has added the following features and drivers for specifically supporting the hardware of the SoM-5282M and the SoM-100ES.
The
SoM-5282EM provides a non-volatile /etc/ filesystem using the internal RAM of
the Coldfire processor.
This
allows users to dynamically change their network and user settings, and
maintain them across resets and power cycles. This is done using the EMAC cfnvram
driver which mounts a portion of the internal RAM as a disk.
Settings
are only lost if the module loses power, which will happen if the battery was
removed or shorted, or if the module is removed from it’s socket. Note that
most OS upgrades can happen without changing them since the /etc/ filesystem is
independent of the main OS.
The
SoM-5282EM has a hardware clock, which can be controlled just like a standard Linux
RTC with the hwclock and date commands. Like the /etc filesystem, the RTC
maintains it’s time via the battery backup voltage from the carrier. This driver
does not support alarm functionality
setting
the hardware clock:
hwclock --set --date 060114322005
(set the clock to june 1st 2:32PM 2005)
updating the date command with the hwclock:
hwclock --hctosys
updating the hwclock with the date setting:
hwclock --systohc
An
MMC driver is provided for autodetecting, initializing, and mounting an MMC/SD
card on the SoM-100EM carrier.
umounting the MMC:
umount /mmc
partitioning the mmc
fdisk /dev/mmc
mounting partition 1 of the MMC in “sync” mode with auto file
system detection
mount –o sync /dev/mmc1 /mmc
reformatting the MMC partition with an ext2 filesystem
mke2fs /dev/mmc1
The
SoM-100ES provides 32 general purpose IO lines that can be configured and
controlled using the egp program. Type egp at the uClinux command prompt with
no arguments to get a description of it's syntax.
COM2
of the SoM-100ES has 422/485 capability. Softwareflow control method for
half-duplex communications can be very difficult to implement and often slow
communication over these channels. To avoid this, the SoM-5282M provides a
hardware flow control setting with it’s hardware/driver. This is typically used
in conjunction with the static Modlib library with EOT.
The
EMAC uClinux distribution provides an LCD driver for the LCD port of the SoM-100ES.
This driver compatible with the popular sourceforge lcd-mod driver, which is
used under normal Linux to control character LCD devices over a parallel port,
it should be compatible with any software written for that API.
Writing
to the LCD is done using standard POSIX read/write commands, which means that
it can be controlled via the command line by dumping data directly into it.
i.e
echo "hello world">/dev/lcd
By
default the lcd driver is loaded expecting a 2 row LCD. This can easily be
modified
to
by reloading the lcd driver with different parameters.
i.e.
rmmod lcd447
insmod lcd447 disp_rows=4
The
current data in the LCD buffer is mirrored by the driver and can be seen by
reading
the
proc/lcd file.
This
driver supports interrupts, debouncing, auto repeat, and dynamically inserting
a
keypad
matrix. The getkey program is included to provide user space methods for doing
blocking/non-blocking
reads, loading and reading the keypad matrix. A sample Matrix
for
an EMAC keypad is also provided which is part of the EMAC distribution.
Drivers and user space programs are provided for reading the values of the AtoD and writing values to the DtoA of the SoM-100ES.
A Driver is provided for reading the values of the AtoD, This uses the same API as the External AtoD driver and can be accessed with the same user space application.
A driver is provided for using the pulse_accumulator of the SoM-5282M as a counter. This driver also provides support for using the 4 interrupts of the pulse_accumulator as software counters.
The API supports starting, stopping, and rollover notification. User space programs supporting the counter driver are available in the EOT.