Project

General

Profile

Software Getting Started » History » Version 13

Anonymous, 02/19/2016 10:49 PM
add note on ubntu-specifics

1 1
== OsmocomBB Getting Started Guide ==
2
3
This page will describe how to compile the firmware, the host utilities and how to use them.
4 10
If you haven't do so already, checkout [wiki:PreliminaryRequirements]
5 1
6
=== Compiling osmocomBB ===
7
osmocomBB consists out of software that is intended to be run on the phone (target) and the host system.
8
9 6 steve-m
==== Dependencies for the host ====
10 1
osmocomBB requires GNU autoconf, automake, libtool, pkg-config, make and GCC to compile. You will
11
also need to use git to access and update the sources. There should be no other depedencies. The name
12
of these packages depend on the distribution used. To
13
14
For Debian the package names are:
15
{{{
16 8
sudo aptitude install libtool shtool autoconf git-core pkg-config make gcc
17 1
}}}
18
19 9
==== Dependencies for the target ====
20 1
To compile software for the target we need a GNU Toolchain for ARM. There are various pre-compiled toolchains
21
available but not all of them will produce working firmware. We will try to support all these configurations but it
22
might take a while to identify the source of a problem.
23
24 3
The toolchains that are known working are the [http://www.gnuarm.com GNUArm.com] ones. They provide a
25
ARM GCC 3.4 .3 for X86 [http://gnuarm.com/bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2 here] and
26
a ARM GCC 4.0.2 for x86_64 [http://gnuarm.com/bu-2.16.1_gcc-4.0.2-c-c++_nl-1.14.0_gi-6.4_x86-64.tar.bz2 here]. The
27 1
toolchain is relocatable and be extracted in your home directory.
28 6 steve-m
29 7
Apparently the arm-elf-gcc 4.3.2 from ports for mac os x can compile the sourcecode as well after symlinking /opt/local/bin/arm-elf-ranlib to /opt/local/bin/arm-elf-linux-ranlib and /opt/local/bin/arm-elf-strip to /opt/local/bin/arm-elf-linux-strip. If you omit the links, there will be unresolvable references to symbols in the libraries.
30
31 6 steve-m
If you want to build your own toolchain, known to be working with OsmocomBB, see here: [wiki:GnuArmToolchain].
32 3
33
An example for x86
34
{{{
35
$ wget http://gnuarm.com/bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2
36
$ mkdir install
37
$ cd install
38
$ tar xjf ../bu-2.15_gcc-3.4.3-c-c++-java_nl-1.12.0_gi-6.1.tar.bz2
39
$ ls gnuarm-3.4.3/bin/arm-elf-gcc
40
}}}
41
42 13
Ubuntu note: gnuarm packages from following ppa are known to work
43
{{{
44
sudo add-apt-repository ppa:bdrung/bsprak
45
sudo apt-get update
46
sudo apt-get install arm-elf-toolchain
47
}}}
48 2
==== Getting and updating the source ====
49 1
{{{
50
git clone git://git.osmocom.org/osmocom-bb.git
51 2
}}}
52
53
{{{
54 8
$ cd osmocom-bb
55 1
$ git pull --rebase
56 9
}}}
57
58
==== Verify the `PATH` environment variable ====
59
60
Please ensure that the cross-compiler is available in your `PATH`, for example by adding the following command to your shell's startup script (e.g. `.bashrc`) or typing it in the terminal you use to build:
61
62
{{{
63
export $PATH:$HOME/install/gnuarm-3.4.3/bin
64 2
}}}
65
66 11
Or on Ubuntu you might want to try:
67
68
{{{
69
export PATH=$PATH:$HOME/install/gnuarm-3.4.3/bin
70
}}}
71
72 12
(presuming it's in your home directory, if you have changed to root it probably wont be :))
73 2
==== Building the source ====
74
Compiling both the target and the host code will happen with the following command. It assumes that the '''arm-elf-gcc'''
75
is inside the current path.
76
77
{{{
78
$ cd src
79
$ make
80
}}}
81 1
82 4
If your GCC binary that produces ARM code is not called '''arm-elf-gcc''' you will need to invoke the following statement
83
and provide the basename of the toolchain with the ending '''-'''.
84 2
85
{{{
86
$ cd src
87
$ make -e CROSS_TOOL_PREFIX=arm-OTHER_NAME-
88 1
}}}
89 4
90
If no error has occured you will have the firmware binaries in ''src/target/firmware/board/compal_e88/*.bin'' that can be
91
used with the Motorola C123. You also have the binaries to run on your host in ''src/host/osmocon/osmocon'', in 
92
''src/host/layer23/src/misc'' and ''layer23/src/mobile''.
93 5
94
95
=== Running osmocomBB ===
96
The original bootloader of Compal and others are built in a way to load code via the serial interface. The [wiki:osmocon]
97
utility implements this protocol and can upload the firmware. Please the [wiki:osmocon] for the details of how to use
98
it properly.
99
100
After the firmware has been loaded the [wiki:osmocon] application will print the output of the serial console
101
and it provides a unix domain socket that another layer of software can connect to. In the case of osmocomBB
102
this higher layer software is called [wiki:layer23] and is actually a group of binaries providing different functionality. Please
103
see [wiki:layer23] for the details.
Add picture from clipboard (Maximum size: 48.8 MB)