GNU Tools for Motorola 68332 with MRM on W2K/Cygnus

Avi Cohen Stuart

(page is still under construction. Check for updates regularly)

What is new?

20 december 2004

8 march 2004

10 September 2003   

4 September 2003.

Introduction

The following is a description on how to download or compile the GNU Tools Suite for the MiniRoboMind (In short MRM) under Windows 2000 in combination with Cygwin. The Tools presented here doesn't have any dependencies with cpu32bug. While this could give shivers to some, the advantage is that one can use these Tools on any 68332, provided it has RAM or Flash to download C/C++ code to the 68332 and initialize it from scratch.(Read: Total Freedom) 

Important note: the libmrm.a that is mentioned on these pages is a minimal(istic) library for the MRM. It appears from a discussion that there are more libmrm.a version.

The GCC Tools suite has been compiled and is ready for download and install. Follow the instructions.

The instructions for gcc-3.4.3/binutils-2.15/newlib-1.12.0/gdb-5.3 compilation can be found here

Install Cygwin first

Download setup.exe from www.cygwin.com. Install the core and development packages. Especially gzip, bzip, tar, gcc, gdb, make and diffutils.

Download

compiled gcc-3.4.3/binutils-2.15/newlib-1.12.0 with m68k-bdm-elf-gdb: gcc-m68k-20041210-m332only.tar.gz

Installation of binaries

The m68k-elf-gcc has been compiled to use /gcc-m68k as its installation directory. If you want another directory you need to recompile the gcc suite. Execute these commands in bash.

Unpack archive:

acohens@cnl07966 /cygdrive/c/data
$ cd /

acohens@cnl07966 /
$ ls
./ ../ bin/ cygwin.bat* cygwin.ico* etc/ gcc-m68k/
gcc-m68k-20041210.tar.gz lib/ tmp/ usr/ var/

acohens@cnl07966 /
$ tar zxf
gcc-m68k-20041210-m332only.tar.gz

Add /gnu-m68k/bin to $PATH

Add the following line to your .bash_profile in your home directory on the Cygwin. (vi ~/.bash_profile):

export PATH=/gcc-m68k/bin:$PATH

Check output of m68k-elf-gcc -v

Start a new Cygwin shell and type in the next command. The gcc for m68k-elf binaries have m68k-elf- prepended. So gcc becomes m68k-elf-gcc, objdump becomes m68k-elf-objdump etc.

acohens@cnl07966 /
$ m68k-elf-gcc -v
Reading specs from /gcc-m68k/lib/gcc/m68k-elf/3.4.0/specs
Configured with: ../../source/gcc-3.4.0/configure --target=m68k-elf --prefix=/gcc-m68k --with-newlib
Thread model: single
gcc version 3.4.3

GDB/BDM setup

gdb as already been installed together with gcc. In order for gdb to access the parallel port the giveio.sys must be installed with loaddrv.exe. Both can be found in directio.zip

Select giveio.sys in WinZip

Install in c:\winnt\system32\drivers or where your %systemroot% is located

Install loaddrv.exe from directio.zip

I installed mine on my desktop because after every reboot the giveio.sys needs to be restarted.

You can start giveio.sys using net start giveio from the command line once it has been installed as a service. This works also from a cygwin shell.

Install and start giveio.sys

Change default path to c:\winnt\system32\drivers\giveio.sys.

Press Install followed by Start

This completes the installation steps for the GCC Tools Suite for the MRM. The next section contains some important stuff on compilation and debugging of C and C++ code for the MRM, including linker details and GDB  startup scripts.


Disclaimer: I know I shouldn't be using FrontPage but a free tool. I'll mend my ways later...