Handy uClinux commands
This page is devoted to uClinux.
It holds some tips and tricks I found on the internet.
This page is more or less for myself, to prevent the data I gathered form being lost on the turbulent internet
GDB on m68k platform:
the debugger can be found in the local user directory (GDB) or a newer version can be build with the command.
For my build i used version 6.6 of GDB and version 4.2.4 of m68k-uclinux-gcc
wget http://ftp.gnu.org/gnu/gdb/gdb-6.6.tar.gz
tar -xzf gdb-6.6.tar.gz
cd gdb-6.6
mkdir build
cd build
../configure --program-prefix=m68k-uclinux- --target=m68k-uclinux --disable-werror
make
sudo make install
The next step is only needed if you need to compile the gdb server for your device
cd ../gdb/gdbserver
export CC=m68k-uclinux-gcc
export LD=m68kuclinux-ld
./configure --host=m68k-uclinux --target=m68k-uclinux
make
cd gdb/gdbserver
open file "configure.srv" and change srv_linux_thread_db=yes into srv_linux_thread_db=no for line : m68*-*-uclinux*)
export CC=m68k-uclinux-gcc
export CFLAGS="-m5307 -g -fomit-frame-pointer -pipe -fno-common -fno-builtin -msep-data"
export LDFLAGS="-Wl,-elf2flt -Wl,-move-rodata -msep-data -m5307"
./configure --host=m68k-uclinux --target=m68k-uclinux
make
We want to upload the gdbserver binary to our device
To debug an application remotely:
- On uClinux/ColdFire "gdbserver :3000 app"
- On host system "gdb app.gdb"
- At gdb command prompt enter "target remote IP:3000"
Building a new toolchain under ubuntu:
make sure you have gcc installed and ncurses Libs
sudo apt-get install build-essentials
sudo apt-get install libncurses5-dev
sudo apt-get build-dep gcc
sudo apt-get install autoconf bison automake
download build and install GMP
download build and install MPFR
Download newest: kernel, uclibc, uclinux, gcc, binutils, elf2flt
Download build script.
extract uclibc and open a terminal to that directory.
now type : make menuconfig and configure uclibc for your device.
for m68knommu disable MMU , posix and shared lib support
set stdio buffer size to a minimum of 256
When you are done select save to alternate file and type in uClibc-.68k.config
find this file and place it one directory up.
untar uclinux now.
Now open build-uclinux-tools.sh and change all versions to the correct ones you have downloaded, and set the correct path to the uclinux directory.
After you are done correcting the paths, type ./build-uclinux-tools.sh build
If something breaks, correct the errors and then run ./build-uclinux-tools.sh continue
