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