annotate doc/Compiling @ 524:4a242cfb9bc5

configs/classic: re-enable the bootloader now that we know what it does
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 22 Sep 2018 03:15:21 +0000
parents 9363ea39c74c
children 6917ea63bffa
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 Preparing the development and build environment
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 ===============================================
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 In order to compile our FreeCalypso Magnetite firmware, you will need a
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 Unix/Linux system. Even though we are using a compiler which we got in the
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 form of Windows .exe binaries and thus have to use Wine (see below), everything
373
9399a83cb394 first round of documentation updates for 2018
Mychaela Falconia <falcon@freecalypso.org>
parents: 311
diff changeset
7 that we have built on top of it is Unix-based. The Mother uses Slackware Linux
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 version 13.37, 32-bit.
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 You will need to install the following four pieces of software on whatever
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 machine you will use to run the FC Magnetite build process:
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 1. Wine: self-explanatory.
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 2. FreeCalypso Wine environment:
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 ftp://ftp.freecalypso.org/pub/GSM/TI_src/wine/installed-env.tar.xz
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 Extract the content of the above tarball into your ~/.wine/drive_c
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 directory - that's all there is to it!
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 3. nowhine wrapper around Wine:
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 ftp://ftp.freecalypso.org/pub/GSM/TI_src/wine/nowhine.c
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 Note that Wine may produce different whines on your system than it
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 does on mine, in which case if you wish to be relieved of those
596d86109e44 initial round of documentation
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>
parents: 251
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>
parents: 251
diff changeset
30 wrapper and create a nowhine symlink pointing directly to wine.
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 4. mokosrec2bin flash image file format conversion utility:
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 ftp://ftp.freecalypso.org/pub/GSM/GTA02/gsm-fw/mokosrec2bin.c
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 Note that the four host software pieces above are exactly the same as what has
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 been needed to build our previous TCS211-based fw works such as leo2moko-debug
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 and tcs211-c139 - thus if you have built those previously, you should already
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 have all of the necessary host tools.
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 Compiling the local helper utilities
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 ====================================
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 (cd helpers; make)
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 Do the above. Most of the build helper scripts used in the FC Magnetite build
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 system are written in Bourne shell, but a few were easier to implement in C.
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 You need to compile these C helper utilities before you can run an actual FC
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 Magnetite firmware build, but these utilities are totally ad hoc and specific
596d86109e44 initial round of documentation
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
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 globally on your system - instead they stay within the fc-magnetite tree. You
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 just need to run make in the helpers directory once before any actual firmware
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 builds.
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 Actually building the firmware
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 ==============================
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 In order to build our FreeCalypso Magnetite firmware for a particular target in
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 a particular configuration, run a command like this from the top level of the
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 fc-magnetite tree:
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61
522
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
62 ./configure.sh fcdev3b hybrid
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63
522
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
64 The first required argument to the configure.sh script selects the target, the
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
65 second required argument selects the build configuration recipe, and any further
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
66 arguments beyond these two (optional) allow changing various configurable
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
67 settings that aren't strictly fixed by the hardware target or by the build
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
68 configuration recipe.
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
69
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
70 As of this writing, the following hardware targets are supported:
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71
381
c6823ed06f9c doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
parents: 373
diff changeset
72 c11x Motorola C11x/12x
c6823ed06f9c doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
parents: 373
diff changeset
73 c139 Motorola C139/140
461
69da44f2909e doc/Compiling: mention that the dsample target is currently D-Sample C05
Mychaela Falconia <falcon@freecalypso.org>
parents: 458
diff changeset
74 dsample TI's D-Sample C05 board (no working radio currently)
251
6c594ce434f8 doc/Compiling: update for the FCDEV3B and for fc-host-tools-r5
Mychaela Falconia <falcon@freecalypso.org>
parents: 220
diff changeset
75 fcdev3b FreeCalypso FCDEV3B
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 gtamodem The Calypso GSM/GPRS modem in Openmoko GTA01/02 smartphones
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 pirelli Pirelli DP-L10
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 For the available configurations (the second required argument to the configure
373
9399a83cb394 first round of documentation updates for 2018
Mychaela Falconia <falcon@freecalypso.org>
parents: 311
diff changeset
80 script), look in the configs directory and read the various write-ups under doc.
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81
522
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
82 Each configuration is built in its own directory; the name of this build
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
83 directory takes the form of build-$TARGET-$CONFIG$SUFFIX, i.e., for the example
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
84 configure.sh line above, the resulting build directory will be named
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
85 build-fcdev3b-hybrid. The $SUFFIX part is empty by default, but can be set on
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
86 the command line in order to distinguish non-standard builds that had some
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
87 tunable settings changed to values other than the default. For example, if you
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
88 are building the hybrid configuration for the fcdev3b target as above, but you
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
89 need to disable MELODY_E2, you could run the configure script as follows:
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
90
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
91 ./configure.sh fcdev3b hybrid MELODY_E2=0 SUFFIX=-noe2
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
92
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
93 The build directory would then become build-fcdev3b-hybrid-noe2, and the
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
94 specified suffix will also be included in the firmware version ID string that
9363ea39c74c configure.sh: implemented SUFFIX= setting, replacing raw BUILD_DIR=
Mychaela Falconia <falcon@freecalypso.org>
parents: 461
diff changeset
95 gets compiled into the image.
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 To actually compile the firmware, cd into the created build directory and run
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 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>
parents: 373
diff changeset
99 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>
parents: 373
diff changeset
100 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>
parents: 373
diff changeset
101 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>
parents: 373
diff changeset
102 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>
parents: 373
diff changeset
103 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>
parents: 373
diff changeset
104 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>
parents: 373
diff changeset
105 source file.
c6823ed06f9c doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
parents: 373
diff changeset
106
c6823ed06f9c doc/Compiling: update for C11x and for the speed-up trick
Mychaela Falconia <falcon@freecalypso.org>
parents: 373
diff changeset
107 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>
parents: 373
diff changeset
108 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>
parents: 373
diff changeset
109 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>
parents: 373
diff changeset
110 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>
parents: 373
diff changeset
111 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>
parents: 373
diff changeset
112 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>
parents: 373
diff changeset
113 right address.
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114
251
6c594ce434f8 doc/Compiling: update for the FCDEV3B and for fc-host-tools-r5
Mychaela Falconia <falcon@freecalypso.org>
parents: 220
diff changeset
115 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>
parents: 220
diff changeset
116 a flashable image or a RAM-loadable one - or both. Because this part of the
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 build system is common with other targets for which only flash images can be
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118 produced, the Makefile always builds the flashable image by default -
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 fwimage.bin is always meant for flash and never for RAM. To build a RAM-
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 loadable image when the target allows it, run 'make ram' - the image will be in
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 ramimage.srec, which you can then load and run on the target with FreeCalypso
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122 host tool fc-xram.
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 Running on the hardware
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 =======================
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 In order to run the firmware you have built on your Calypso phone or modem
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 (flash or run in RAM as appropriate), you will need to use FreeCalypso host
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 tools. As of this writing, the latest packaged release is this one:
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130
458
48ae9825662c doc/Compiling: update for fc-host-tools-r8 and dsample target
Mychaela Falconia <falcon@freecalypso.org>
parents: 381
diff changeset
131 ftp://ftp.freecalypso.org/pub/GSM/FreeCalypso/fc-host-tools-r8.tar.bz2
94
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132
596d86109e44 initial round of documentation
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 Please see target-specific notes for more details.