You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-9Lines changed: 25 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -268,16 +268,30 @@ $ mbed remove text-lcd
268
268
269
269
After importing a program or creating a new one, you need to tell mbed CLI where to find the toolchains that you want to use for compiling your source tree.
270
270
271
-
There are two ways to do this:
272
-
* Through the mbed CLI configuration.
273
-
* Via mbed_settings.py file in the root of your program, which is automatically created (if it doesn't already exist).
271
+
There are multiple ways to configure toolchain locations:
272
+
*`mbed_settings.py` file in the root of your program. The tools will automatically create this file if it doesn't already exist.
273
+
* The mbed CLI configuration.
274
+
* Setting an environment variable.
275
+
* Adding directory of the compiler binary to your PATH.
276
+
277
+
Methods for configuring toolchains that appear earlier in the above list override methods that appear later.
278
+
279
+
#### Through mbed_settings.py
280
+
281
+
Edit `mbed_settings.py` to set your toolchain:
282
+
283
+
* To use the [ARM Compiler toolchain](https://developer.arm.com/products/software-development-tools/compilers/arm-compiler-5/downloads), set `ARM_PATH` to the *base* directory of your ARM Compiler installation (example: C:\Program Files\ARM\armcc5.06). The recommended version of the ARM Compiler toolchain is 5.06.
284
+
* To use the [GCC ARM Embedded toolchain](https://launchpad.net/gcc-arm-embedded), set `GCC_ARM_PATH` to the *binary* directory of your GCC ARM installation (example: C:\Program Files\GNU Tools ARM Embedded\4.9 2015q2\bin). Use version 4.9 of GCC ARM Embedded; version 5.0 or any more recent version might be incompatible with the tools.
285
+
* To use the [IAR EWARM toolhain](https://www.iar.com/iar-embedded-workbench/#!?architecture=ARM), set `IAR_PATH` to the *base* directory of your IAR installation. Use versions 7.80 of IAR EWARM; prior versions might be incompatible with the tools.
286
+
287
+
Because `mbed_settings.py` contains local settings (possibly relevant only to a single OS on a single machine), you should not check it into version control.
274
288
275
289
#### Through mbed CLI configuration
276
290
277
291
You can set the ARM Compiler 5 location via the command:
[mbed] C:\Program Files\ARM now set as global ARM_PATH
282
296
```
283
297
@@ -299,14 +313,16 @@ No local configuration is set
299
313
300
314
More information about mbed CLI configuration is available in the [configuration section](#mbed-cli-configuration) of this document.
301
315
302
-
#### Through mbed_settings.py
316
+
#### Setting environment variable
303
317
304
-
Edit `mbed_settings.py` to set your toolchain:
318
+
For each of the compilers, `mbed compile` checks a corresponding environment variable for the compiler's location. The environment variables are as follows:
319
+
*`MBED_ARM_PATH`: The path to the *base* directory of your ARM Compiler installation. This should be the directory containing the directory containing the binaries for `armcc` and friends.
320
+
*`MBED_IAR_PATH`: The path to the *base* directory of your IAR EWARM Compiler installation. This should be one directory containing the directory containing the binaries for `iccarm` and friends.
321
+
*`MBED_GCC_ARM_PATH`: The path to the *binary* directory of your GCC ARM Embedded Compiler installation. This should be the directory containing the binaries for `arm-none-eabi-gcc` and friends.
305
322
306
-
* If you want to use the [ARM Compiler toolchain](https://developer.arm.com/products/software-development-tools/compilers/arm-compiler-5/downloads), set `ARM_PATH` to the *base* directory of your ARM Compiler installation (example: C:\Program Files\ARM\armcc5.06). The recommended version of the ARM Compiler toolchain is 5.06.
307
-
* If you want to use the [GCC ARM Embedded toolchain](https://launchpad.net/gcc-arm-embedded), set `GCC_ARM_PATH` to the *binary* directory of your GCC ARM installation (example: C:\Program Files\GNU Tools ARM Embedded\4.9 2015q2\bin). Use versions 4.9 of GCC ARM Embedded; version 5.0 or any version above may be incompatible with the tools.
323
+
#### Compiler detection through the `PATH`
308
324
309
-
As a rule, because `mbed_settings.py` contains local settings (possibly relevant only to a single OS on a single machine), it should not be versioned.
325
+
If none of the above are configured, the `mbed compile` command will fall back to checking your `PATH` for an executable that is part of the compiler suite in question. This check is the same as a shell would perform to find the executable on the command-line. When `mbed compile` finds the executable it is looking for, it uses the location of that executable as the appropriate path except in the case of GCC, which will not use a path.
0 commit comments