0c2461b827dce1ae0d749e377929f07071fd694b
[fw/cortex-toolchain] / README
1 REMEMBER!
2 =========
3 THE RESULTING TOOLCHAIN IS FOR BARE BONE ARM PROCESSOR SOFTWARE. NOT FOR USE
4 WITH GLIBC OR THE LINUX KERNEL. DO NOT EVEN BOTHER TO ASK FOR THAT!
5
6 To compile the ARM toolchain for barebone ARM devices:
7 ======================================================
8 * Run ./summon-arm-toolchain
9 * Profit
10
11 Command line options
12 ====================
13
14 You can suffix the script call with the following variable parameters:
15
16 TARGET=
17 -------
18
19 By default the target is arm-none-eabi, you may want to use a different target, for example arm-elf. Use that option on your own risk it may brake things.
20
21 PREFIX=
22 -------
23
24 By default the installation prefix is "$(HOME)/sat" you can change it to "/usr" then the binaries will be installed into "/usr/bin" and the toolchain specific
25 files in "/usr/arm-none-eabi" assuming you did not change the TARGET variable.
26
27 DARWIN_OPT_PATH=
28 ----------------
29
30 When compiling on Mac OS X the build script has to know where MacPorts or Fink
31 is installed. The default value is "/opt/local".
32
33 SUDO=
34 -----
35
36 By default this variable is empty. If you need root rights for the install
37 step you may set this variable to "sudo".
38
39   $ ./summon-arm-toolchain SUDO=sudo
40
41 This will prefix all make install steps with the sudo command asking for
42 your root password.
43
44 QUIET=
45 ------
46
47 By default set to 0. To decrease console output (may increase compile speed
48 in some cases) you can set this variable to 1.
49
50 USE_LINARO=
51 -----------
52
53 By default set to 1. To disable the usage of the Linaro GCC and use of the
54 vanilla GCC instead set to 0.
55
56 OOCD_EN=
57 --------
58
59 By default set to 1. To disable compilation of OpenOCD JTAG programming
60 software set to 0.
61
62 LIBSTM32_EN=
63 ------------
64
65 By default set to 0. To enable compilation of the non-free libstm32 library
66 set to 1.
67
68 LIBOPENSTM32_EN=
69 ----------------
70
71 By default set to 1. To disable compilation of the open source libopenstm32
72 library set to 0.
73
74 DEFAULT_TO_CORTEX_M3=
75 ---------------------
76
77 By default set to 0. To enable compilation of binutils and GCC to generate code
78 for the Cortex-M3 ARM architecture by default set to 0. Tests have shown that
79 using these options is not very reliable and is discouraged. It is more
80 reliable to add the necessary options to your build environment instead.
81
82 CPUS=
83 -----
84
85 Overrides the autodetection of CPU cores on the host machine. This option
86 is translated into the -j$CPUS+1 option to the make command when running
87 the script.
88
89 Example:
90 --------
91
92   $ ./summon-arm-toolchain LIBSTM32_EN=1 CPUS=5
93
94 This will run the script with libstm32 enabled and with 5 CPUs on your host
95 machine resulting in calling all make commands with -j6.
96
97 Currently tested and known to work target platforms:
98 ====================================================
99
100 * STM32F10x (Olimex STM32-H103 eval board, Open-BLDC v0.1, v0.2, v0.3, v1.0)
101
102 Currently tested and known to work host platforms:
103 ==================================================
104
105 * Linux 32bit and 64bit (Debian unstable)
106 * Mac OS X Snow Leopard with MacPorts
107
108 Notes for Mac OS X users:
109 =========================
110
111 For Mac OS X there are a few dependencies which must be installed. The wget
112 and libftdi packages are required and gmp, mpfr, mpc and libiconv are needed
113 by GCC-4.5.1. These can be installed using MacPorts, DarwinPorts or fink.
114
115   $ port install gmp mpfr libmpc wget libftdi
116
117 For XML support in gdb you may want to install expat too. And add the 
118 --with-expat parameter to the GDB target.
119
120 Notes for Linux users:
121 ====================== 
122 You need to install several packages. On Debian just run:
123
124   $ apt-get install flex bison libgmp3-dev libmpfr-dev libncurses5-dev \
125     libmpc-dev autoconf texinfo build-essential
126
127 You may want to try running the following command instead too:
128
129   $ apt-get build-dep gcc-4.5
130
131 For XML support in gdb you may want to install libexpat1 and libexpat1-dev too. 
132
133 Usage notes:
134 ============
135
136 We support multilib now in SAT thanks to Eric Parsonage's and Bernard
137 Davison's amazing work. You want to use the following GCC flag combinations to
138 generate full fledged floating point supporting code for some selected
139 architectures.
140
141 * stm32 (probably cortex-m3 in general): -mthumb -march=armv7 -mfix-cortex-m3-ldrd -msoft-float
142 * lpc21 (thumb instruction set): -mthumb -msoft-float
143 * lpc21 (arm instruction set): -mthumb -march=armv4t -msoft-float
144
145 If you need support for some other ARM MCU and know the parameters for it,
146 just drop us a line and we will add that combination to the multilibs.
147
148 You can list available combinations by running:
149
150   $ arm-none-eabi-gcc -print-multi-lib
151
152 How to submit improvements and patches
153 ======================================
154
155 As more and more people start to submit patches and improvements to
156 Summon-Arm-Toolchain (SAR) this section seems to become necessary.
157
158 First of all any way of submission is appreciated, if you just want to dump
159 your version of the script to us feel free to do so. Still if you want your
160 improvements and fixes to go upstream quicker there is a good way to do that.
161
162 1) Create an account on GitHub (or some other git hosting service, if you
163    really have to).
164 2) Fork the main SAR repository.
165 3) Clone the forked repository to your disk.
166 4) Change the script, try to make small changes adding one feature or bugfix at
167    a time (that makes review much easier for us).
168 5) Push your changes to GitHub, or the other service you chose.
169 6) Test your changes, by compiling the toolchain (you probably want to do that
170    with different options).
171 7) Make sure that everything still works.
172 8) Test a little bit more.
173 9) Click on "pull request" on GitHub or drop us a line so that we can pull your
174    changes.
175
176 I know that sounds like a lot of work, but if you don't we have to do it and
177 that means that your awesome improvement or bugfix will take longer to be
178 integrated into the official script. And as you, we want everyone to profit
179 from such changes sooner then later. :)
180