Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
Getting Started
Booting the Kernel
Booting the kernel using gdb
ST Logo
Previous   Contents   Next

Why use gdb?
The st40load download tool, which was previously used to boot Linux onto a target CPU is derived from the MCDT toolset st40run program. However these programs are no longer being maintained, and while it would be possible in the short term to continue to produce st40load compatible configuration files, longer term this is not possible as new devices will require enhancements to the download tool itself.
So for all new developments we recommend the use of gdb.

The MCDT Gnu Micro Toolset provides the sh4gdb program to download code onto the target. This program can be used to download an arbitrary ELF format file onto the target CPU, and this includes the Linux kernel.

Note that the only part of the GNU Toolset which is used when developing Linux applications is sh4gdb. The compilers, libraries and associated tools are not used, and ones provided with the Linux distribution should be used instead.

The MCDT Gnu Micro Toolset is provided as part of the ST Micro Connect package.

Although it is possible to use sh4gdb directly, many users find it easier to use a wrapper script which provides an st40load style command line, using sh4gdb as the underlying download mechanism.

The st40load_gdb script takes a subset of the arguments of st40load:

  • -b kernel specify the kernel ELF file to download.
  • -c command is the gdb command to be executed to initialise the target's registers. This is typically the target board's name.
  • -n do not start running automatically. Enter interactive mode after loading the kernel.
  • -t target name or IP address of the micro connect.
  • -x address,filename used to download a ramdisk image. address is the address where the ramdisk should be loaded, filename is the ramdisk image file.
  • -- arguments any remaining arguments are passed to the Linux kernel as its command line.

This allows a simple script to be constructed to download Linux onto the target:

#!/bin/sh

JEI=fred                # Name of the JEI, HTI or MicroConnect
TARGETIP=10.0.0.56      # IP address to be given to the target
SERVERIP=10.0.0.96      # IP address of your NFS server
GWIP=10.0.0.1           # IP address of your network gateway
NETMASK=255.255.255.0   # Local network subnet mask
NAME=jim		# Initial hostname for the target
AUTOCONF=off		# Try to determine addresses automatically?

# Root of target's file system
SERVERDIR=/opt/STM/ST40Linux-1.0/devkit/sh4/target

# Kernel image
KERNEL=$SERVERDIR/boot/vmlinux-stb1overdrive

st40load_gdb \
        -t $JEI \
        -b $KERNEL \
        -c mb379 \
	-- \
        console=ttySC0 \
        root=/dev/nfs \
        nfsroot=$SERVERIP:$SERVERDIR \
        ip=$TARGETIP::$GWIP:$NETMASK:$NAME::$AUTOCONF \
        mem=32m

The st40load_gdb script can be downloaded from the /pub/st40load directory on the FTP server.

Previous   Contents   Next
Valid HTML 4.01! Last updated: 2004/03/25 11:42:33
© Copyright STMicroelectronics Limited, 2005
Printer