-
Notifications
You must be signed in to change notification settings - Fork 17
8051 Requirements
This guide lists the packages required before you can build/use Contiki's 8051-based ports.
Information on this page has been tested on Ubuntu and on Mac OS X. Things should work on Cygwin but may require some tweaking.
This guide is a clone of the guide on GitHub. In cases where you see conflicting information, this page here wins.
Make sure you have the following installed:
- gcc
- flex
- bison
- Boost C++ Libraries (package libboost-graph-dev in the ubuntu archive)
- Python
- srecord (http://srecord.sourceforge.net/)
- If you want to run border routers on Mac OS X, you will also need http://tuntaposx.sourceforge.net/ TunTap
- To build srecord on OS X, you may need to install GNU libtool. An easy way to do it is via homebrew.
make libtool --mode=compile --tag=CXX g++ \ -g -O2 -I. -c srec_cat/arglex3.cc -o \ srec_cat/arglex3.lo libtool: unknown option character `-' in: --mode=compile Usage: libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] Usage: libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load] make: *** [srec_cat/arglex3.lo] Error 1
Try this:
libtool -V Apple Inc. version cctools-822
If you install GNU libtool via homebrew, it will be prefixed with a 'g':
glibtool --version libtool (GNU libtool) 2.4.2 Written by Gordon Matzigkeit <[email protected]>, 1996 Copyright (C) 2011 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Change srecord's build system to use glibtool instead of libtool and you are sorted.
- Homebrew is also an easy way to install libboost
brew install boost
In order to compile contiki, you need a version of the SDCC compiler. Unfortunately, the binary packages don't contain all the libraries we need so you will have to compile SDCC from sources.
Before anything else, make sure you don't have a pre-installed version from the Ubuntu archive!
SDCC supports various device types. You can compile it with support for all of them or only some. The port of interest to us is the mcs51. Disabling all other ports will make the compile considerably faster.
Recent Tested SDCC revisions: 7100
- Download a recommended revision from the SDCC svn (replace [rev] with one of the numbers above):
svn co -r [rev] https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc/
- cd into the extracted directory. This will be called `sdcc`
- Now you need to hack sdcc's build system a bit, in order to get correct library versions.
- Edit
device/lib/incl.mk
. We need model-huge and model-large libraries. To instruct the build system to build model-huge libraries, find this line:MODELS = small medium large
Addhuge
. You may removesmall
andmedium
if you only use SDCC for contiki, but make sure you keeplarge
. So your new line may end up looking like thisMODELS = small large huge
- Edit
device/lib/Makefile.in
. Find this line:TARGETS += models small-mcs51-stack-auto
Replace it with thisTARGETS += models model-mcs51-stack-auto
- Edit
- Run this:
./configure --disable-gbz80-port --disable-z80-port --disable-ds390-port \ --disable-ds400-port --disable-pic14-port --disable-pic16-port \ --disable-hc08-port --disable-r2k-port --disable-z180-port \ --disable-sdcdb --disable-ucsim
- If you don't have root access you will probably want to change the installation directory. You can do that with the
--prefix=dir
option of the./configure
stage. - If you get any errors about missing packages, fix them.
- If you don't have root access you will probably want to change the installation directory. You can do that with the
make
-
make install
as root or with sudo
sdcc -v
and see if it's in the PATH. If not, add it. If SDCC is in the PATH and you have compiled excluding unused ports, sdcc -v
will show you something like this:
SDCC : mcs51 3.0.6 #7000 (Nov 1 2011) (Linux)
The list of supported ports appears after the : and before the version number. If you build everything this message will be a lot longer.