Development Environment for UFS-910 Applications

To develop applications for the UFS-910 you need a PC running Linux and STLinux 2.0. You may also use a virtual machine running Linux rather than using a real PC. STMicroelectronics is the manufacturer of ST40 processor used in the UFS-910. STLinux is the operating system running on the UFS-910.

Selection and Installation of the host system

Supported Linux distribution for STLinux are RedHat and Fedora (see STLinux: Linux installation on the host PC). I'm using Fedora Core 6 because I already have experience in using it. STLinux 2.0 is officially supported with Fedora Core 4 but Core 6 can be also used when following thes instructions below.

Installation of Fedora Core 6 using VirtualPC

VirtualPC 2007 is a free virtual machine software from Mircosoft for Windows XP.

The DefaultDepth value must be adjusted before starting X11 because Fedora does not recognize the 16-Bit settings used by VirtualPC. For the same reason installation must be done in text mode.

Firewall and SELinux must be disabled zo avoid problems when using STLinux

The compat-libstdc++ library is required when using STLinux 2.0.

STLinux Installation

STLinux should be now installed to '/opt/STM/STLinux-2.0'. Please see the STLinux web page for installation of the optional source packages.

Configuration of development environment

You should add a new user for development. When using avirtual machine, this user will be probably the only one on the system. Add these lines to the '~/.bashrc' file of the user. So the STLinux Cross compilers will be used rather the X86 ones:

export CC="/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-gcc"
export CXX="/opt/STM/STLinux-2.0/devkit/sh4/bin/sh4-linux-g++"

Packages with 'configure' script must be configured using './configure --host=sh4-linux'.

Now you should create a directory in the user's home directory that will be used to hold the UFS-910 applications (you may name it 'ufs-910'. This directory may be also mounted to an external NFS share.

Copy files to the UFS-910

To copy files, the development machine and the UFS-910 must be both connected to your local network.

FTP

When you have installed a FTP server on the UFS-910, you may use this script to upload files (the script may be also called from within the install section of Makefiles):

# !/bin/bash
# to-ufs.sh: Copy a file to UFS-910 using ftp
#
# Jochen Arndt <joe127@t-online.de>

# IP address of UFS-910
UFS_IP="192.168.178.19"
# Default destination directory
DESTDIR="/data"
# Use "-v" to be verbose or "" to be not verbose
#VERBOSE=""
VERBOSE="-v"

FTP=`which ftp`
if [ "$FTP" = "" ]; then
    echo "Error: ftp program not found."
    exit 1
fi

CHMOD=""
if [ "$1" = "-c" ]; then
    CHMOD="yes"
    shift
fi

if [ "$1" = "" -o "$1" = "-h" -o "$1" = "--help" ]; then
    echo "Usage: $0 [-c] <file-name> [dest-dir [dest-file]]"
    echo " -c        = change mode to 755 after copying"
    echo " file-name = file to be copied"
    echo " dest-dir  = destination directory (/data by default)"
    echo " dest-file = file name on target (basename of file-name by default)"
    exit 0
fi
if [ ! -e "$1" ]; then
    echo "Error: File '$1' not found."
    exit 1
fi
if [ ! -f "$1" ]; then
    echo "Error: '$1' is not a file."
    exit 1
fi

# Default name on destination host
DESTNAME=`basename $1`
test -n "$2" && DESTDIR="$2"
test -n "$3" && DESTNAME="$3"

test -n "$CHMOD" && CHMOD="chmod 755 $DESTNAME"

"$FTP" "$VERBOSE" -u -n "$UFS_IP" <<-EOF
    user root kathrein
    binary
    cd $DESTDIR
    put $1 $DESTNAME
    $CHMOD
    quit
EOF
NFS

You may also install a NFS server on the development system and create a share to the local directory holding the UFS-910 files (if it is'nt a mounted NFS share). The UFS can automatically mount the NFS share upon booting when creating the file '/config/nfs':

NFS <IP>:<SHARE> false soft,udp,nolock,async,wsize=8192,rsize=8192,noatime

To mount a NFS share manually use:

mkdir /tmp/nfs
mount -t nfs -o soft,udp,nolock,async,wsize=8192,rsize=8192,noatime <IP>:<SHARE> /tmp/usb/nfs

[German Start Page]German Start Page    [Home]Home