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