From 32f5115056fd5c00d2326110c9a373eb470f8d06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Wed, 28 Aug 2013 16:03:05 +0200 Subject: [PATCH] Adds basic README for compiling the gw, fixed rtems.cfg. rtems.cfg now has proper path to the rtems git. README.gw contains a basic sequence of steps needed to compile the gw, starting from compiling build tools, compiling rtems and then compiling gw. --- rtems/gw/README.gw | 37 +++++++++++++++++++++++++++++++++++++ rtems/rtems.cfg | 6 +++--- 2 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 rtems/gw/README.gw diff --git a/rtems/gw/README.gw b/rtems/gw/README.gw new file mode 100644 index 0000000..ef03378 --- /dev/null +++ b/rtems/gw/README.gw @@ -0,0 +1,37 @@ +Quick README regarding compilation of CAN GW for RTEMS + + +Preparing Toolchain +1) RTEMS compilation setup requires quite recent autoconf (2.68+) and automake (1.12+), so if your version is older, build those two first. +2) For compilation itself, you will need Binutils, GCC, Newlib. Their version is normally specified +by RTEMS git, for our GW setup it is by http://git.rtems.org/rtems-source-builder/tree/rtems/config/4.10/rtems-powerpc.bset. + -- At the time of making of this README it was binutils-2.20.1, gcc-4.4.7(core + g++) and newlib-1.18.0. +You can get those from RTEMS ftp, ftp://www.rtems.com/pub/rtems/SOURCES/4.10/. You will also need RTEMS patches from the same location. + +Binutils and gcc need to be configured with --target=powerpc-rtems4.10, gcc needs to have newlib symlinked into its source directory +and specified --with-newlib --enable-threads. + +For more specifics refer either to http://www.rtems.org/wiki/index.php/Building_Tools or http://aps.anl.gov/epics/base/RTEMS/Building-4.10.2.txt + + + + +Building RTEMS +Assuming you have downloaded sources from RTEMS git. +1) Run ./bootstrap from RTEMS directory. +2) Create build directory, run rtems.cfg from there. (Note: it assumes that you used --prefix/opt/rtems-4.10 while configuring build tools) +3) Build RTEMS with make RTEMS_BSP="icecube" +4) Install RTEMS, and add RTEMS_MAKEFILE_PATH=/powerpc-rtems4.10/icecube to your bash profile. + + +Building GW +Note: You will need mkimage tool from uboot. +1) Run make default-config +2) Run make to compile the GW +3) Run ./mkimg to create bootable uboot image from the GW. + +This will create build that has RTEMS shell enabled along with commands for starting and stopping the gateway, enabling eth driver and +starting and stopping CPU load generator. Because we had trouble communicating with the board over serial, there are also "bench builds", +which deactivate shell, autostart CAN gateway and possible autoactivate CPU load. Currently those can be build via uncommenting defines +inside app_def.h (I will change this to make targets in the future.) + diff --git a/rtems/rtems.cfg b/rtems/rtems.cfg index a0a4deb..3a26f63 100755 --- a/rtems/rtems.cfg +++ b/rtems/rtems.cfg @@ -1,6 +1,6 @@ #!/bin/sh -./configure --target=powerpc-rtems4.10 \ +./rtems-4.10/configure --target=powerpc-rtems4.10 \ --prefix=/opt/rtems-4.10 \ --enable-rtems-inlines --disable-multiprocessing \ --enable-cxx --enable-rdbg \ @@ -10,6 +10,6 @@ --disable-multilib --disable-docs \ --verbose \ --enable-rtemsbsp="icecube" - - + + #Note: If working on glab, use rtems4.10.2 instead of rtems4.10 -- there is already compiled build toolchain for that target. \ No newline at end of file -- 2.39.2