HOWTO: Development enviroment setup:

Overview:

Install m68k toolchain:

Execute these 2 lines in the directory where you downloaded m68k stuff. Stdout is dumped to log for easier removal later

# sh m68k-uclinux-tools-base-gcc3.4.0-20040603.sh >> m68k-gcc3.4.0-installLog
# sh m68k-uclinux-tools-gdb-20040603.sh >> m68k-gdb-installLog

These the m68k files are taken from the uclinux page

Update PATH

You have to update your path so that your shell knows where to get the m68k binaries. Note you have to do this for each user who will be compiling.

# export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/local/m68k-uclinux-tools/bin/'

It might be a good idea to update ~/.bashrc so it always sets the path. Below is an exurb from my ~/.bashrc file.

#for m68k stuff
PATH=$PATH:$HOME:/usr/local/m68k-uclinux-tools/bin/
export PATH

Update m528x libraries

The old m528x libraries don't work with _this_ version of m68k binaries, so you'll need to update them.

# tar -xvjf m68k-elf-libraries.tar.bz2
# mv /usr/local/m68k-uclinux-tools/lib/gcc/m68k-uclinux/3.4.0/m528x /usr/local/m68k-uclinux-tools/lib/gcc/m68k-uclinux/3.4.0/m528x~
# mv /usr/local/m68k-uclinux-tools/m68k-uclinux/lib/m528x /usr/local/m68k-uclinux-tools/m68k-uclinux/lib/m528x~
# cp -R m68k-elf-libraries/lib/m528x /usr/local/m68k-uclinux-tools/m68k-uclinux/lib/
# cp -R m68k-elf-libraries/lib/gcc/m68k-uclinux/3.4.0/m528x /usr/local/m68k-uclinux-tools/lib/gcc/m68k-uclinux/3.4.0/

Compile

Compilation should work at this point, cd to the appropriate branch and run make cleanall and make

n3c/quadros/Examples/Quadros_ss+OpenTCP/Mcf523x/n3c/Projects/gnu$ make cleanall; make

Upload using serial port

Before you continue configuring BDM you can try uploading the program over serial, refer to this manual for instructions on configuring minicom. Once connected to the coldfire type dl then press ^a s and pass the n3c/quadros/Examples/Quadros_ss+OpenTCP/Mcf523x/M523xBCC/Projects/gnu/bin/quadros_ss.s19 path to minicom. Once upload you can start execution with go 20000.

Note: uploading over serial is a SLOW process and therefore it is more convenient to use BDM port while developing, even if you are not using the debugger.

BDM configuration

Install driver as described here but use m68k-bdm-1.3.0/driver/linux-2.6/ as m68k-bdm-1.3.0/driver/linux/ wont compile, also you can use make install to install the module in proper location. Make sure your kernel has kernel hacking enabled. When you first try BDM it might be a good idea to run it as root sudo.

BDM configuration -- Troubleshooting

When installation of the driver complete, connect the parallel cable and check that all lights on the target board are green. If there is a red light (which happens often), then try to reboot the computer with the target board switched on and parallel cable connected.

BDM configuration -- migrating cygwin sources.

If you are using sources which are provided with the devboard (ignore if you are using svn sources) you need to first convert the gdb file to unix with the dos2unix tool.

n3c/quadros/Examples/Quadros_ss/Mcf523x/M523xBCC/Projects/gnu$ dos2unix MCF523xEVB_PnE-run.gdb
Then you need to edit the .gdb file and replace some occurences of _ with - on the last dozen or so lines. Finally you need to make a linux friendly run (run_target) file example below.
#!/bin/bash
make && m68k-bdm-elf-gdb -q --command=MCF523xEVB_PnE-run.gdb bin/quadros_ss.elf
If you are having permissions problems you can try it with sudo (make sure its installed and configured)
#!/bin/bash
make && sudo /usr/local/m68k-uclinux-tools/bin/m68k-bdm-elf-gdb --command=5282run.gdb bin/quadros_ss.elf

Compiling and Uploading

Using the run_target script one can conveniently compile and upload the binary to the coldfire

n3c/quadros/Examples/Quadros_ss+OpenTCP/Mcf523x/n3c/Projects/gnu$ ./run_target