94
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 Preparing the development and build environment
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 ===============================================
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 In order to compile our FreeCalypso Magnetite firmware, you will need a
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
5 Unix/Linux system. Even though we are using a compiler which we got in the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
6 form of Windows .exe binaries and thus have to use Wine (see below), everything
|
373
|
7 that we have built on top of it is Unix-based. The Mother uses Slackware Linux
|
94
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
8 version 13.37, 32-bit.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
10 You will need to install the following four pieces of software on whatever
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
11 machine you will use to run the FC Magnetite build process:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
12
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
13 1. Wine: self-explanatory.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
14
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
15 2. FreeCalypso Wine environment:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
16
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
17 ftp://ftp.freecalypso.org/pub/GSM/TI_src/wine/installed-env.tar.xz
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
18
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
19 Extract the content of the above tarball into your ~/.wine/drive_c
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
20 directory - that's all there is to it!
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
21
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
22 3. nowhine wrapper around Wine:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
23
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
24 ftp://ftp.freecalypso.org/pub/GSM/TI_src/wine/nowhine.c
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
25
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
26 Note that Wine may produce different whines on your system than it
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
27 does on mine, in which case if you wish to be relieved of those
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 whines, you'll need to edit my nowhine.c hack for your situation.
|
310
8488a9ae583c
doc/Compiling: added note that if wine doesn't whine, make nowhine a symlink
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
29 And if wine does not whine at all on your system, you can skip the
|
8488a9ae583c
doc/Compiling: added note that if wine doesn't whine, make nowhine a symlink
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
30 wrapper and create a nowhine symlink pointing directly to wine.
|
94
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
32 4. mokosrec2bin flash image file format conversion utility:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
33
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
34 ftp://ftp.freecalypso.org/pub/GSM/GTA02/gsm-fw/mokosrec2bin.c
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
35
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
36 Note that the four host software pieces above are exactly the same as what has
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
37 been needed to build our previous TCS211-based fw works such as leo2moko-debug
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
38 and tcs211-c139 - thus if you have built those previously, you should already
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
39 have all of the necessary host tools.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
40
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
41 Compiling the local helper utilities
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
42 ====================================
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
43
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
44 (cd helpers; make)
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
45
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
46 Do the above. Most of the build helper scripts used in the FC Magnetite build
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
47 system are written in Bourne shell, but a few were easier to implement in C.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
48 You need to compile these C helper utilities before you can run an actual FC
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
49 Magnetite firmware build, but these utilities are totally ad hoc and specific
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
50 to the needs of our fw build system, hence they are not meant to be installed
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
51 globally on your system - instead they stay within the fc-magnetite tree. You
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
52 just need to run make in the helpers directory once before any actual firmware
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
53 builds.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
54
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
55 Actually building the firmware
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
56 ==============================
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
57
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
58 In order to build our FreeCalypso Magnetite firmware for a particular target in
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
59 a particular configuration, run a command like this from the top level of the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
60 fc-magnetite tree:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
61
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
62 ./configure.sh gtamodem l1reconst
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
63
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
64 The first argument to the configure.sh script selects the target, and the second
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
65 argument selects the configuration. As of this writing, the following targets
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
66 are supported:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
67
|
381
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
68 c11x Motorola C11x/12x
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
69 c139 Motorola C139/140
|
251
6c594ce434f8
doc/Compiling: update for the FCDEV3B and for fc-host-tools-r5
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
70 fcdev3b FreeCalypso FCDEV3B
|
94
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
71 gtamodem The Calypso GSM/GPRS modem in Openmoko GTA01/02 smartphones
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
72 pirelli Pirelli DP-L10
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
73
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
74 For the available configurations (the second required argument to the configure
|
373
|
75 script), look in the configs directory and read the various write-ups under doc.
|
94
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
76
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
77 Each configuration is built in its own directory; by default the build directory
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
78 is named build-$TARGET-$CONFIG, i.e., for the example configure.sh line above,
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
79 the resulting build directory will be build-gtamodem-l1reconst. You can change
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
80 the name of this directory by appending a BUILD_DIR=dir argument to the
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
81 ./configure.sh line after the two required arguments.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
82
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
83 To actually compile the firmware, cd into the created build directory and run
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
84 make there. Unfortunately the use of TI's proprietary compiler via Wine makes
|
381
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
85 the build quite slow, but there is a trick to speed it up: if you run some
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
86 other Wine program that stays open and does not exit on its own (e.g., wine cmd)
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
87 in another window and leave it open while you run your FC Magnetite fw build,
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
88 the build will proceed much faster - the presence of another Wine process using
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
89 the wineserver environment will keep Wine from shutting this environment down
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
90 and restarting it for every individual cl470 run, i.e., for each individual C
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
91 source file.
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
92
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
93 When the build is done, the flashable firmware image will be in fwimage.bin.
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
94 This image is to be flashed with fc-loadtool at address 0x10000 on Mot C11x and
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
95 C139 targets, and at address 0 on the more sensible targets that have the
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
96 Calypso boot ROM enabled. The build system also produces a short text file
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
97 named flash-script which is a flashing command script for fc-loadtool that
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
98 erases the correct range of flash sectors and then programs fwimage.bin at the
|
c6823ed06f9c
doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
99 right address.
|
94
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
100
|
251
6c594ce434f8
doc/Compiling: update for the FCDEV3B and for fc-host-tools-r5
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
101 When building firmware for the FCDEV3B or for the Pirelli, one can build either
|
6c594ce434f8
doc/Compiling: update for the FCDEV3B and for fc-host-tools-r5
Mychaela Falconia <falcon@freecalypso.org>
diff
changeset
|
102 a flashable image or a RAM-loadable one - or both. Because this part of the
|
94
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
103 build system is common with other targets for which only flash images can be
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
104 produced, the Makefile always builds the flashable image by default -
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
105 fwimage.bin is always meant for flash and never for RAM. To build a RAM-
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
106 loadable image when the target allows it, run 'make ram' - the image will be in
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
107 ramimage.srec, which you can then load and run on the target with FreeCalypso
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
108 host tool fc-xram.
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
109
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
110 Running on the hardware
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
111 =======================
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
112
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
113 In order to run the firmware you have built on your Calypso phone or modem
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
114 (flash or run in RAM as appropriate), you will need to use FreeCalypso host
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
115 tools. As of this writing, the latest packaged release is this one:
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
116
|
311
|
117 ftp://ftp.freecalypso.org/pub/GSM/FreeCalypso/fc-host-tools-r7.tar.bz2
|
94
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
118
|
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
119 Please see target-specific notes for more details.
|