Beginner uClinux and Linux for the Motorola M5272C3: HOWTO

 

Copyright (C) 2003,

Riaan van Boom riaan@redelec.co.za

Version 1.0.0-20030507

 

contents

††††††††††† introduction

††††††††† linux installation

††††††††† tftp daemon

††††††††† terminal emulator

download the tools

m68k-elf toolchain

uClinux distribution

compiling the basics

program the uC

 

 

introduction

This document is intended for those who are new comers to uClinux as well as Linux. I used Linux RedHat 8.0 and RedHat 7.3 as my OS. I used the Motorola MCF5272 ColdFire evaluation board: M5272C3. Everything in this document is based on this configuration.

 

This document is a step by step guide to setting up the software up to a point where the kernel can be downloaded to the evaluation board.

 

I am myself new at this, so bear with me. This documents the steps I followed to get to the point where I can upload images to the board. I cannot at this point give any support on development of applications for uClinux. I cannot at this point give any support on different systems either. If this guide does not work as planned, donít bang me up about it, I tried to include everything. Simply mail me:

 

††††††††††††††††††††††† riaan@redelec.co.za

††††††††††† <<contents††††††

 

linux installation

-         Install Linux on the PC: I used Redhat 8.0 and/or Redhat 7.3. I donít think it really matters which distro you useÖ Just check the compatibility of older distroís with the installed components for uClinux. Make sure that you install all development tools. They will be needed for setting up and compiling the uClinux.

-         Set up your networking, preferably with a manually configured IP address, run

 

setup

†††††††††††

††††††††††† as root and configure your IP settings.

 

††††††††††† <<contents

 

tftp daemon

-         RH 8.0/7.3 does not, by default, install a tftp (trivial file transfer protocol) server. An easy way to check this is to run:

 

setup

†††††††††††

as root. Go to system services and check if there is a tftpd available.

The tftp daemon is needed for loading binary files to the MCF5272C3 board, using the dBug firmware on the uC.

 

-         If the tftpd is not installed: For RH 8.0/7.3 it is on CD#3 in the RPM directory. You can either install it by running it from the CD in X, or you can boot up with CD#1 and select upgrade installation. When upgrading, select the tftpd package under daemons and continue the installation.

 

-         Login as root and run the setup program again. Check (enable) the tftpd in system services. This will enable tftpd at start-up. You will have to reboot the machine or restart xinetd service, in order to activate the tftpd.

 

-         You will also have to make sure that your firewall will let tftp connections through. Alternatively you can disable the firewall altogether.

 

-         As root, create the directory /tftpboot by running:

 

mkdir /tftpboot

 

-         You probably shouldnít develop as root, so you need to give your users permission to use this folder. The easiest way to do this:

chmod 777 /tftpboot

††††

†††† <<contents

 

terminal emulator

-         You will need a terminal emulator, for communicating through your PCís com port. This is the interface through which you communicate with the dBug firmware. I use minicom. As root run:

 

minicom Ės

 

-         this will give you the minicom configuration menu.

 

-         Go to serial port setup. If you are using ttyS0 (com 1) to connect to the board, change the serial device to /dev/ttyS0 (Thatís a zero after the S). If you are connecting through ttyS1 (com 2) change to /dev/ttyS1 etc. Set the Bps/Par/Bits setting to 19200 bps, 8 data bits and no parity bits (19200 8N1). Turn hardware flow control of, and turn software flow control on.

 

-         Save the setup as dfl. This will ensure that minicom is always setup in this way and for all users.

 

-         You need to give your users access to the serial port you are using. The easiest way again, as root, for ttyS0:

 

chmod 777 /dev/ttyS0

 

†††† <<contents

 

download the tools

Your Linux OS is now setup for the task. We still need to install the m68k-elf toolchain and also the uClinux distribution. Download them from the following links:

 

the uClinux full distribution

http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20030305.tar.gz

 

the m68k-elf toolchain

http://www.uclinux.org/pub/uClinux/m68k-elf-tools/m68k-elf-tools-20030314.sh

 

††††††††††† <<contents

 

m68k-elf toolchain

††††††††††† The installation of the m68k-elf toolchain is very simple. As root, run:

†††††††††††††††††††††††††††††††††††

††††††††††††††††††††††††††††††††††† sh m68k-elf-tools-20030314.sh

†††††††††††

††††††††††† from the directory you downloaded it to. The whole installation is automatic.

 

††††††††††† <<contents

 

uClinux distribution

Installing uClinux is just as simple. Log in as the user you are going to use for the development. Copy the file uClinux-dist-20030305.tar.gz to the userís home directory, or wherever you want to work from. For the home directory, run:

 

††††††††††††††††††††††† cp uClinux-dist-20030305.tar.gz /home/user

 

from the directory you downloaded the file to. user should be replaced by your user name.

 

Go to your chosen directory and run:

 

††††††††††††††††††††††† tar xzvf uClinux-dist-20030305.tar.gz

 

The uClinux file structure will be extracted to the chosen directory. A sub-directory is created called uClinux-dist, which contains the whole distribution.

 

††††††††††† <<contents

 

compiling the basics

We are now ready to compile the kernel into a binary file. You donít need to be logged on as root from this point. Go to the uClinux-dist directory and run:

 

††††††††††††††††††††††† make xconfig

 

This will run a graphic configuration program. Select your vendor/product combination. For the purpose of this document we use Motorola/M5272C3.

Set the rest of the settings as required (leave everything as it is for now). Save and exit.

 

When the process completes run:

 

††††††††††††††††††††††† make dep

 

which determines all the dependencies and a few other bits of tasks. When this completes, run:

 

††††††††††††††††††††††† make

 

After the compiling is done (and there is no errors) there should be a newbinary file, image.bin, in your /tftpboot directory.

 

††††††††††† <<contents

 

program the uC

First, connect the board to your PCís Ethernet card, using a cross over cable. Connect the serial cable to the board as well as your chosen serial port on the PC.††††

Enter minicom by running:

 

††††††††††††††††††††††† minicom

 

Apply power to the board. The dBug firmware should run and leave you with a command prompt.Give the command:

 

††††††††††††††††††††††† set client xxx.xxx.xxx.xxx

 

supplying the IP address you want to use for the board. And also run

 

††††††††††††††††††††††† set server xxx.xxx.xxx.xxx

 

Everything should be setup correctly now. To get more info on the dBug software, type

 

††††††††††††††††††††††† help <keyword>

 

or just help. Now type

 

††††††††††††††††††††††† dn

 

The binary file will be downloaded into user memory. To run uClinux type

 

††††††††††††††††††††††† go 20000

 

uClinux will then run and give you the all familiar command prompt in your terminal emulator.

 

††††††††††† <<contents

 

Copyright (C) 2003,

Riaan van Boom riaan@redelec.co.za

 

†††††††††††††††††††††††