Greg Steiert / maxim_dev

Dependents:   sensomed

Committer:
switches
Date:
Tue Nov 08 18:27:11 2016 +0000
Revision:
0:0e018d759a2a
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
switches 0:0e018d759a2a 1 # Mbed SDK build script environment
switches 0:0e018d759a2a 2 ## Introduction
switches 0:0e018d759a2a 3 Mbed test framework allows users to test their mbed devices’ applications, build mbed SDK library, re-run tests, run mbed SDK regression, add new tests and get all this results automatically. Everything is done on your machine so you have a full control over compilation, and tests you run.
switches 0:0e018d759a2a 4
switches 0:0e018d759a2a 5 It's is using Python 2.7 programming language to drive all tests so make sure Python 2.7 is installed on your system and included in your system PATH. To compile mbed SDK and tests you will need one or more supported compilers installed on your system.
switches 0:0e018d759a2a 6
switches 0:0e018d759a2a 7 To follow this short introduction you should already:
switches 0:0e018d759a2a 8 * Know what mbed SDK is in general.
switches 0:0e018d759a2a 9 * Know how to install Python 2.7, ARM target cross compilers.
switches 0:0e018d759a2a 10 * You have C/C++ programming experience and at least willingness to learn a bit about Python.
switches 0:0e018d759a2a 11
switches 0:0e018d759a2a 12 ## Test automation
switches 0:0e018d759a2a 13 Currently our simple test framework allows users to run tests on their machines (hosts) in a fully automated manner. All you need to do is to prepare two configuration files.
switches 0:0e018d759a2a 14
switches 0:0e018d759a2a 15 ## Test automation limitations
switches 0:0e018d759a2a 16 Note that for tests which require connected external peripherals, for example Ethernet, SD flash cards, external EEPROM tests, loops etc. you need to:
switches 0:0e018d759a2a 17
switches 0:0e018d759a2a 18 * Modify test source code to match components' pin names to actual mbed board pins where peripheral is connected or
switches 0:0e018d759a2a 19 * Wire your board the same way test defines it.
switches 0:0e018d759a2a 20
switches 0:0e018d759a2a 21 ## Prerequisites
switches 0:0e018d759a2a 22 mbed test suite and build scripts are Python 2.7 applications and require Python 2.7 runtime environment and [setuptools](https://pythonhosted.org/an_example_pypi_project/setuptools.html) to install dependencies.
switches 0:0e018d759a2a 23
switches 0:0e018d759a2a 24 What we need:
switches 0:0e018d759a2a 25 * Installed [Python 2.7](https://www.python.org/download/releases/2.7) programming language.
switches 0:0e018d759a2a 26 * Installed [setuptools](https://pythonhosted.org/an_example_pypi_project/setuptools.html#installing-setuptools-and-easy-install)
switches 0:0e018d759a2a 27 * Optionally you can install [pip](https://pip.pypa.io/en/latest/installing.html) which is the PyPA recommended tool for installing Python packages from command line.
switches 0:0e018d759a2a 28
switches 0:0e018d759a2a 29 mbed SDK in its repo root directory specifies ```setup.py``` file which holds information about all packages which are dependencies for it. Bear in mind only few simple steps are required to install all dependencies.
switches 0:0e018d759a2a 30
switches 0:0e018d759a2a 31 First, clone mbed SDK repo and go to mbed SDk repo's directory:
switches 0:0e018d759a2a 32 ```
switches 0:0e018d759a2a 33 $ git clone https://github.com/mbedmicro/mbed.git
switches 0:0e018d759a2a 34 $ cd mbed
switches 0:0e018d759a2a 35 ```
switches 0:0e018d759a2a 36
switches 0:0e018d759a2a 37 Second, invoke ```setup.py``` so ```setuptools``` can install mbed SDK's dependencies (external Python modules required by mbed SDK):
switches 0:0e018d759a2a 38 ```
switches 0:0e018d759a2a 39 $ python setup.py install
switches 0:0e018d759a2a 40 ```
switches 0:0e018d759a2a 41 or
switches 0:0e018d759a2a 42 ```
switches 0:0e018d759a2a 43 $ sudo python setup.py install
switches 0:0e018d759a2a 44 ```
switches 0:0e018d759a2a 45 when your system requires administrator rights to install new Python packages.
switches 0:0e018d759a2a 46
switches 0:0e018d759a2a 47 ### Manual Python package dependency installation
switches 0:0e018d759a2a 48 In case you do not want to install whole mbed package using ```setuptools```, you can use ```requirements.txt``` file and with help of ```pip`` package manager install only mbed's Python package dependencies:
switches 0:0e018d759a2a 49 ```
switches 0:0e018d759a2a 50 $ pip install -r requirements.txt
switches 0:0e018d759a2a 51 ```
switches 0:0e018d759a2a 52 ## Prerequisites (manual Python package dependency installation)
switches 0:0e018d759a2a 53 **Please only read this chapter if you had problems installing mbed SDK dependencies to Python packages**.
switches 0:0e018d759a2a 54
switches 0:0e018d759a2a 55 Below you can find the list of mbed SDK dependencies to Python modules with instructions how to install them manually.
switches 0:0e018d759a2a 56
switches 0:0e018d759a2a 57 You can skip this part if you've already install [Python 2.7](https://www.python.org/download/releases/2.7) and [setuptools](https://pythonhosted.org/an_example_pypi_project/setuptools.html) and successfully [installed all dependencies](#prerequisites).
switches 0:0e018d759a2a 58
switches 0:0e018d759a2a 59 * Please make sure you've installed [pip](https://pip.pypa.io/en/latest/installing.html) or [easy_install](https://pythonhosted.org/setuptools/easy_install.html#installing-easy-install)
switches 0:0e018d759a2a 60 Note: Easy Install is a python module (easy_install) bundled with [setuptools](https://pythonhosted.org/an_example_pypi_project/setuptools.html#installing-setuptools-and-easy-install) that lets you automatically download, build, install, and manage Python packages.
switches 0:0e018d759a2a 61
switches 0:0e018d759a2a 62 * Installed [pySerial](https://pypi.python.org/pypi/pyserial) module for Python 2.7.
switches 0:0e018d759a2a 63 pySerial can be installed from PyPI, either manually downloading the files and installing as described below or using:
switches 0:0e018d759a2a 64 ```
switches 0:0e018d759a2a 65 $ pip install pyserial
switches 0:0e018d759a2a 66 ```
switches 0:0e018d759a2a 67 or:
switches 0:0e018d759a2a 68 ```
switches 0:0e018d759a2a 69 easy_install -U pyserial
switches 0:0e018d759a2a 70 ```
switches 0:0e018d759a2a 71 * Installed [prettytable](https://code.google.com/p/prettytable/wiki/Installation) module for Python 2.7.
switches 0:0e018d759a2a 72 prettytable can be installed from PyPI, either manually downloading the files and installing as described below or using:
switches 0:0e018d759a2a 73 ```
switches 0:0e018d759a2a 74 $ pip install prettytable
switches 0:0e018d759a2a 75 ```
switches 0:0e018d759a2a 76 * Installed [IntelHex](https://pypi.python.org/pypi/IntelHex) module.
switches 0:0e018d759a2a 77 IntelHex may be downloaded from https://launchpad.net/intelhex/+download or http://www.bialix.com/intelhex/.
switches 0:0e018d759a2a 78 Assuming Python is properly installed on your platform, installation should just require running the following command from the root directory of the archive:
switches 0:0e018d759a2a 79 ```
switches 0:0e018d759a2a 80 sudo python setup.py install
switches 0:0e018d759a2a 81 ```
switches 0:0e018d759a2a 82 This will install the intelhex package into your system’s site-packages directory. After that is done, any other Python scripts or modules should be able to import the package using:
switches 0:0e018d759a2a 83 ```
switches 0:0e018d759a2a 84 $ python
switches 0:0e018d759a2a 85 Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32
switches 0:0e018d759a2a 86 Type "help", "copyright", "credits" or "license" for more information.
switches 0:0e018d759a2a 87 >>> from intelhex import IntelHex
switches 0:0e018d759a2a 88 >>>
switches 0:0e018d759a2a 89 ```
switches 0:0e018d759a2a 90 * You can check if you have correctly installed the above modules (or you already have them) by starting Python and importing both modules.
switches 0:0e018d759a2a 91 ```
switches 0:0e018d759a2a 92 $ python
switches 0:0e018d759a2a 93 Python 2.7.8 (default, Jun 30 2014, 16:03:49) [MSC v.1500 32 bit (Intel)] on win32
switches 0:0e018d759a2a 94 Type "help", "copyright", "credits" or "license" for more information.
switches 0:0e018d759a2a 95 >>> import serial
switches 0:0e018d759a2a 96 >>> import prettytable
switches 0:0e018d759a2a 97 >>> from intelhex import IntelHex
switches 0:0e018d759a2a 98 >>>
switches 0:0e018d759a2a 99 ```
switches 0:0e018d759a2a 100 * Installed Git open source distributed version control system.
switches 0:0e018d759a2a 101 * Installed at least one of the supported by Mbed SDK workspace tools compilers:
switches 0:0e018d759a2a 102
switches 0:0e018d759a2a 103 Compiler | Mbed SDK Abbreviation | Example Version
switches 0:0e018d759a2a 104 -----------------------|-----------------------|-----------
switches 0:0e018d759a2a 105 Keil ARM Compiler | ARM, uARM | ARM C/C++ Compiler, 5.03 [Build 117]
switches 0:0e018d759a2a 106 GCC ARM | GCC_ARM | gcc version 4.8.3 20131129 (release)
switches 0:0e018d759a2a 107 GCC CodeRed | GCC_CR | gcc version 4.6.2 20121016 (release)
switches 0:0e018d759a2a 108 IAR Embedded Workbench | IAR | IAR ANSI C/C++ Compiler V6.70.1.5641/W32 for ARM
switches 0:0e018d759a2a 109
switches 0:0e018d759a2a 110 * Mbed board. You can find list of supported platforms [here](https://mbed.org/platforms/).
switches 0:0e018d759a2a 111
switches 0:0e018d759a2a 112 ### Getting Mbed SDK sources with test suite
switches 0:0e018d759a2a 113 So you have already installed Python (with required modules) together with at least one supported compiler you will use with your mbed board. Great!
switches 0:0e018d759a2a 114
switches 0:0e018d759a2a 115 Now let's go further and try to get Mbed SDK with test suite together. So let's clone latest Mbed SDK source code and configure path to our compiler(s) in next few steps.
switches 0:0e018d759a2a 116
switches 0:0e018d759a2a 117 * Open console and run command below to clone Mbed SDK repository hosted on [Github](https://github.com/mbedmicro/mbed).
switches 0:0e018d759a2a 118 ```
switches 0:0e018d759a2a 119 $ git clone https://github.com/mbedmicro/mbed.git
switches 0:0e018d759a2a 120 Cloning into 'mbed'...
switches 0:0e018d759a2a 121 remote: Counting objects: 37221, done.
switches 0:0e018d759a2a 122 remote: Compressing objects: 100% (3/3), done.
switches 0:0e018d759a2a 123 remote: Total 37221 (delta 0), reused 0 (delta 0), pack-reused 37218
switches 0:0e018d759a2a 124 Receiving objects: 100% (37221/37221), 20.38 MiB | 511.00 KiB/s, done.
switches 0:0e018d759a2a 125 Resolving deltas: 100% (24455/24455), done.
switches 0:0e018d759a2a 126 Checking connectivity... done.
switches 0:0e018d759a2a 127 Checking out files: 100% (3994/3994), done.
switches 0:0e018d759a2a 128 ```
switches 0:0e018d759a2a 129 * Now you can go to mbed directory you've just cloned and you can see root directory structure of our Mbed SDK library sources. Just type following commands:
switches 0:0e018d759a2a 130 ```
switches 0:0e018d759a2a 131 $ cd mbed
switches 0:0e018d759a2a 132 $ ls
switches 0:0e018d759a2a 133 LICENSE MANIFEST.in README.md libraries setup.py travis tools
switches 0:0e018d759a2a 134 ```
switches 0:0e018d759a2a 135 Directory structure we are interested in:
switches 0:0e018d759a2a 136 ```
switches 0:0e018d759a2a 137 mbed/tools/ - test suite scripts, build scripts etc.
switches 0:0e018d759a2a 138 mbed/libraries/tests/ - mbed SDK tests,
switches 0:0e018d759a2a 139 mbed/libraries/tests/mbed/ - tests for mbed SDK and peripherals tests,
switches 0:0e018d759a2a 140 mbed/libraries/tests/net/echo/ - tests for Ethernet interface,
switches 0:0e018d759a2a 141 mbed/libraries/tests/rtos/mbed/ - tests for RTOS.
switches 0:0e018d759a2a 142 ```
switches 0:0e018d759a2a 143
switches 0:0e018d759a2a 144 ### Workspace tools
switches 0:0e018d759a2a 145 Workspace tools are set of Python scripts used off-line by Mbed SDK team to:
switches 0:0e018d759a2a 146 * Compile and build mbed SDK,
switches 0:0e018d759a2a 147 * Compile and build libraries included in mbed SDK repo like e.g. ETH (Ethernet), USB, RTOS or CMSIS,
switches 0:0e018d759a2a 148 * Compile, build and run mbed SDK tests,
switches 0:0e018d759a2a 149 * Run test regression locally and in CI server,
switches 0:0e018d759a2a 150 * Get library, target, test configuration (paths, parameters, names etc.).
switches 0:0e018d759a2a 151
switches 0:0e018d759a2a 152 ### Configure workspace tools to work with your compilers
switches 0:0e018d759a2a 153 Before we can run our first test we need to configure our test environment a little!
switches 0:0e018d759a2a 154 Now we need to tell workspace tools where our compilers are.
switches 0:0e018d759a2a 155
switches 0:0e018d759a2a 156 * Please to go ```mbed``` directory and create empty file called ```mbed_settings.py```.
switches 0:0e018d759a2a 157 ```
switches 0:0e018d759a2a 158 $ touch mbed_settings.py
switches 0:0e018d759a2a 159 ```
switches 0:0e018d759a2a 160 * Populate this file the Python code below:
switches 0:0e018d759a2a 161 ```python
switches 0:0e018d759a2a 162 from os.path import join
switches 0:0e018d759a2a 163
switches 0:0e018d759a2a 164 # ARMCC
switches 0:0e018d759a2a 165 ARM_PATH = "C:/Work/toolchains/ARMCompiler_5.03_117_Windows"
switches 0:0e018d759a2a 166 ARM_BIN = join(ARM_PATH, "bin")
switches 0:0e018d759a2a 167 ARM_INC = join(ARM_PATH, "include")
switches 0:0e018d759a2a 168 ARM_LIB = join(ARM_PATH, "lib")
switches 0:0e018d759a2a 169
switches 0:0e018d759a2a 170 ARM_CPPLIB = join(ARM_LIB, "cpplib")
switches 0:0e018d759a2a 171 MY_ARM_CLIB = join(ARM_PATH, "lib", "microlib")
switches 0:0e018d759a2a 172
switches 0:0e018d759a2a 173 # GCC ARM
switches 0:0e018d759a2a 174 GCC_ARM_PATH = "C:/Work/toolchains/gcc_arm_4_8/4_8_2013q4/bin"
switches 0:0e018d759a2a 175
switches 0:0e018d759a2a 176 # GCC CodeRed
switches 0:0e018d759a2a 177 GCC_CR_PATH = "C:/Work/toolchains/LPCXpresso_6.1.4_194/lpcxpresso/tools/bin"
switches 0:0e018d759a2a 178
switches 0:0e018d759a2a 179 # IAR
switches 0:0e018d759a2a 180 IAR_PATH = "C:/Work/toolchains/iar_6_5/arm"
switches 0:0e018d759a2a 181
switches 0:0e018d759a2a 182 SERVER_ADDRESS = "127.0.0.1"
switches 0:0e018d759a2a 183 LOCALHOST = "127.0.0.1"
switches 0:0e018d759a2a 184
switches 0:0e018d759a2a 185 # This is moved to separate JSON configuration file used by singletest.py
switches 0:0e018d759a2a 186 MUTs = {
switches 0:0e018d759a2a 187 }
switches 0:0e018d759a2a 188 ```
switches 0:0e018d759a2a 189
switches 0:0e018d759a2a 190 Note: You need to provide the absolute path to your compiler(s) installed on your host machine. Replace corresponding variable values with paths to compilers installed in your system:
switches 0:0e018d759a2a 191 * ```ARM_PATH``` for armcc compiler.
switches 0:0e018d759a2a 192 * ```GCC_ARM_PATH``` for GCC ARM compiler.
switches 0:0e018d759a2a 193 * ```GCC_CR_PATH``` for GCC CodeRed compiler.
switches 0:0e018d759a2a 194 * ```IAR_PATH``` for IAR compiler.
switches 0:0e018d759a2a 195
switches 0:0e018d759a2a 196 If for example you do not use ```IAR``` compiler you do not have to modify anything. Workspace tools will use ```IAR_PATH`` variable only if you explicit ask for it from command line. So do not worry and replace only paths for your installed compilers.
switches 0:0e018d759a2a 197
switches 0:0e018d759a2a 198 Note: Because this is a Python script and ```ARM_PATH```, ```GCC_ARM_PATH```, ```GCC_CR_PATH```, ```IAR_PATH``` are Python string variables please use double backlash or single slash as path's directories delimiter to avoid incorrect path format. For example:
switches 0:0e018d759a2a 199 ```python
switches 0:0e018d759a2a 200 ARM_PATH = "C:/Work/toolchains/ARMCompiler_5.03_117_Windows"
switches 0:0e018d759a2a 201 GCC_ARM_PATH = "C:/Work/toolchains/gcc_arm_4_8/4_8_2013q4/bin"
switches 0:0e018d759a2a 202 GCC_CR_PATH = "C:/Work/toolchains/LPCXpresso_6.1.4_194/lpcxpresso/tools/bin"
switches 0:0e018d759a2a 203 IAR_PATH = "C:/Work/toolchains/iar_6_5/arm"
switches 0:0e018d759a2a 204 ```
switches 0:0e018d759a2a 205
switches 0:0e018d759a2a 206 Note: Settings in ```mbed_settings.py``` will overwrite variables with default values in ```mbed/default_settings.py``` file.
switches 0:0e018d759a2a 207
switches 0:0e018d759a2a 208 ## Build Mbed SDK library from sources
switches 0:0e018d759a2a 209 Let's build mbed SDK library off-line from sources using your compiler. We've already cloned mbed SDK sources, we've also installed compilers and added their paths to ```mbed_settings.py```.
switches 0:0e018d759a2a 210 We now should be ready to use workspace tools script ```build.py``` to compile and build mbed SDK from sources.
switches 0:0e018d759a2a 211
switches 0:0e018d759a2a 212 We are still using console. You should be already in ```mbed/tools/``` directory if not go to ```mbed/tools/``` and type below command:
switches 0:0e018d759a2a 213 ```
switches 0:0e018d759a2a 214 $ python build.py -m LPC1768 -t ARM
switches 0:0e018d759a2a 215 ```
switches 0:0e018d759a2a 216 or if you want to take advantage from multi-threaded compilation please use option ```-j X``` where ```X``` is number of cores you want to use to compile mbed SDK. See below:
switches 0:0e018d759a2a 217 ```
switches 0:0e018d759a2a 218 $ python build.py -m LPC1768 -t ARM -j 4
switches 0:0e018d759a2a 219 Building library CMSIS (LPC1768, ARM)
switches 0:0e018d759a2a 220 Copy: core_ca9.h
switches 0:0e018d759a2a 221 Copy: core_caFunc.h
switches 0:0e018d759a2a 222 ...
switches 0:0e018d759a2a 223 Compile: us_ticker_api.c
switches 0:0e018d759a2a 224 Compile: wait_api.c
switches 0:0e018d759a2a 225 Library: mbed.ar
switches 0:0e018d759a2a 226 Creating archive 'C:\temp\x\mbed\build\mbed\TARGET_LPC1768\TOOLCHAIN_ARM_STD\mbed.ar'
switches 0:0e018d759a2a 227 Copy: board.o
switches 0:0e018d759a2a 228 Copy: retarget.o
switches 0:0e018d759a2a 229
switches 0:0e018d759a2a 230 Completed in: (42.58)s
switches 0:0e018d759a2a 231
switches 0:0e018d759a2a 232 Build successes:
switches 0:0e018d759a2a 233 * ARM::LPC1768
switches 0:0e018d759a2a 234 ```
switches 0:0e018d759a2a 235 Above command will build mbed SDK for [LPC1768](http://developer.mbed.org/platforms/mbed-LPC1768/) platform using ARM compiler.
switches 0:0e018d759a2a 236
switches 0:0e018d759a2a 237 Let's have a look at directory structure under ```mbed/build/```. We can see for ```LPC1768``` new directory ```TARGET_LPC1768``` was created. This directory contains all build primitives.
switches 0:0e018d759a2a 238 Directory ```mbed/TARGET_LPC1768/TOOLCHAIN_ARM_STD/``` contains mbed SDK library ```mbed.ar```. This directory structure also stores all needed headers which you should use with ```mbed.ar``` when building your own software.
switches 0:0e018d759a2a 239 ```
switches 0:0e018d759a2a 240 $ tree ./mbed/build/
switches 0:0e018d759a2a 241 Folder PATH listing
switches 0:0e018d759a2a 242 Volume serial number is 006C006F 6243:3EA9
switches 0:0e018d759a2a 243 ./MBED/BUILD
switches 0:0e018d759a2a 244 +---mbed
switches 0:0e018d759a2a 245 +---.temp
switches 0:0e018d759a2a 246 ¦ +---TARGET_LPC1768
switches 0:0e018d759a2a 247 ¦ +---TOOLCHAIN_ARM_STD
switches 0:0e018d759a2a 248 ¦ +---TARGET_NXP
switches 0:0e018d759a2a 249 ¦ +---TARGET_LPC176X
switches 0:0e018d759a2a 250 ¦ +---TOOLCHAIN_ARM_STD
switches 0:0e018d759a2a 251 +---TARGET_LPC1768
switches 0:0e018d759a2a 252 +---TARGET_NXP
switches 0:0e018d759a2a 253 ¦ +---TARGET_LPC176X
switches 0:0e018d759a2a 254 ¦ +---TARGET_MBED_LPC1768
switches 0:0e018d759a2a 255 +---TOOLCHAIN_ARM_STD
switches 0:0e018d759a2a 256 ```
switches 0:0e018d759a2a 257
switches 0:0e018d759a2a 258 Note: Why ```LCP1768```? For this example we are using ```LPC1768``` because this platform supports all compilers so you are sure you only need to specify proper compiler.
switches 0:0e018d759a2a 259
switches 0:0e018d759a2a 260 If you are not using ARM Compiler replace ```ARM``` with your compiler nickname: ```GCC_ARM```, ```GCC_CR``` or ```IAR```. For example if you are using IAR type command:
switches 0:0e018d759a2a 261 ```
switches 0:0e018d759a2a 262 $ python build.py -m LPC1768 -t IAR
switches 0:0e018d759a2a 263 ```
switches 0:0e018d759a2a 264
switches 0:0e018d759a2a 265 Note: Workspace tools track changes in source code. So if for example mbed SDK or test source code changes ```build.py``` script will recompile project with all dependencies. If there are no changes in code consecutive mbed SDK re-builds using build.py will not rebuild project if this is not necessary. Try to run last command once again, we can see script ```build.py``` will not recompile project (there are no changes):
switches 0:0e018d759a2a 266 ```
switches 0:0e018d759a2a 267 $ python build.py -m LPC1768 -t ARM
switches 0:0e018d759a2a 268 Building library CMSIS (LPC1768, ARM)
switches 0:0e018d759a2a 269 Building library MBED (LPC1768, ARM)
switches 0:0e018d759a2a 270
switches 0:0e018d759a2a 271 Completed in: (0.15)s
switches 0:0e018d759a2a 272
switches 0:0e018d759a2a 273 Build successes:
switches 0:0e018d759a2a 274 * ARM::LPC1768
switches 0:0e018d759a2a 275 ```
switches 0:0e018d759a2a 276
switches 0:0e018d759a2a 277 ### build.py script
switches 0:0e018d759a2a 278
switches 0:0e018d759a2a 279 Build script located in mbed/tools/ is our core script solution to drive compilation, linking and building process for:
switches 0:0e018d759a2a 280
switches 0:0e018d759a2a 281 * mbed SDK (with libs like Ethernet, RTOS, USB, USB host).
switches 0:0e018d759a2a 282 * Tests which also can be linked with libraries like RTOS or Ethernet.
switches 0:0e018d759a2a 283
switches 0:0e018d759a2a 284 Note: Test suite also uses the same build script, inheriting the same properties like auto dependency tracking and project rebuild in case of source code changes.
switches 0:0e018d759a2a 285
switches 0:0e018d759a2a 286 Build.py script is a powerful tool to build mbed SDK for all available platforms using all supported by mbed cross-compilers. Script is using our workspace tools build API to create desired platform-compiler builds. Use script option ```--h``` (help) to check all script parameters.
switches 0:0e018d759a2a 287 ```
switches 0:0e018d759a2a 288 $ python build.py --help
switches 0:0e018d759a2a 289 ```
switches 0:0e018d759a2a 290
switches 0:0e018d759a2a 291 * The command line parameter ```-m``` specifies the MCUs/platforms for which you want to build the mbed SDK. More than one MCU(s)/platform(s) may be specified with this parameter using comma as delimiter.
switches 0:0e018d759a2a 292 Example for one platform build:
switches 0:0e018d759a2a 293 ```
switches 0:0e018d759a2a 294 $ python build.py -m LPC1768 -t ARM
switches 0:0e018d759a2a 295 ```
switches 0:0e018d759a2a 296 or for many platforms:
switches 0:0e018d759a2a 297 ```
switches 0:0e018d759a2a 298 $ python build.py -m LPC1768,NUCLEO_L152RE -t ARM
switches 0:0e018d759a2a 299 ```
switches 0:0e018d759a2a 300
switches 0:0e018d759a2a 301 * Parameter ```-t``` defined which toolchain should be used for mbed SDK build. You can build Mbed SDK for multiple toolchains using one command.
switches 0:0e018d759a2a 302 Below example (note there is no space after commas) will compile mbed SDK for Freescale Freedom KL25Z platform using ARM and GCC_ARM compilers:
switches 0:0e018d759a2a 303 ```
switches 0:0e018d759a2a 304 $ python build.py -m KL25Z -t ARM,GCC_ARM
switches 0:0e018d759a2a 305 ```
switches 0:0e018d759a2a 306
switches 0:0e018d759a2a 307 * You can combine this technique to compile multiple targets with multiple compilers.
switches 0:0e018d759a2a 308 Below example will compile mbed SDK for Freescale's KL25Z and KL46Z platforms using ARM and GCC_ARM compilers:
switches 0:0e018d759a2a 309 ```
switches 0:0e018d759a2a 310 $ python build.py -m KL25Z,KL46Z -t ARM,GCC_ARM
switches 0:0e018d759a2a 311 ```
switches 0:0e018d759a2a 312
switches 0:0e018d759a2a 313 * Building libraries included in mbed SDK's source code. Parameters ```-r```, ```-e```, ```-u```, ```-U```, ```-d```, ```-b``` will add ```RTOS```, ```Ethernet```, ```USB```, ```USB Host```, ```DSP```, ```U-Blox``` libraries respectively.
switches 0:0e018d759a2a 314 Below example will build Mbed SDK library for for NXP LPC1768 platform together with RTOS (```-r``` switch) and Ethernet (```-e``` switch) libraries.
switches 0:0e018d759a2a 315 ```
switches 0:0e018d759a2a 316 $ python build.py -m LPC1768 -t ARM -r -e
switches 0:0e018d759a2a 317 Building library CMSIS (LPC1768, ARM)
switches 0:0e018d759a2a 318 Building library MBED (LPC1768, ARM)
switches 0:0e018d759a2a 319 Building library RTX (LPC1768, ARM)
switches 0:0e018d759a2a 320 Building library RTOS (LPC1768, ARM)
switches 0:0e018d759a2a 321 Building library ETH (LPC1768, ARM)
switches 0:0e018d759a2a 322
switches 0:0e018d759a2a 323 Completed in: (0.48)s
switches 0:0e018d759a2a 324
switches 0:0e018d759a2a 325 Build successes:
switches 0:0e018d759a2a 326 * ARM::LPC1768
switches 0:0e018d759a2a 327 ```
switches 0:0e018d759a2a 328
switches 0:0e018d759a2a 329 * If you’re unsure which platforms and toolchains are supported please use switch ```-S``` to print simple matrix of platform to compiler dependencies.
switches 0:0e018d759a2a 330 ```
switches 0:0e018d759a2a 331 $ python build.py -S
switches 0:0e018d759a2a 332 +-------------------------+-----------+-----------+-----------+-----------+-----------+
switches 0:0e018d759a2a 333 | Platform | ARM | uARM | GCC_ARM | IAR | GCC_CR |
switches 0:0e018d759a2a 334 +-------------------------+-----------+-----------+-----------+-----------+-----------+
switches 0:0e018d759a2a 335 | APPNEARME_MICRONFCBOARD | Supported | Default | Supported | - | - |
switches 0:0e018d759a2a 336 | ARCH_BLE | Default | - | Supported | Supported | - |
switches 0:0e018d759a2a 337 | ARCH_GPRS | Supported | Default | Supported | Supported | Supported |
switches 0:0e018d759a2a 338 ...
switches 0:0e018d759a2a 339 | UBLOX_EVK_ODIN_W2 | Supported | Default | Supported | Supported | - |
switches 0:0e018d759a2a 340 | WALLBOT_BLE | Default | - | Supported | Supported | - |
switches 0:0e018d759a2a 341 | XADOW_M0 | Supported | Default | Supported | Supported | Supported |
switches 0:0e018d759a2a 342 +-------------------------+-----------+-----------+-----------+-----------+-----------+
switches 0:0e018d759a2a 343 *Default - default on-line compiler
switches 0:0e018d759a2a 344 *Supported - supported off-line compiler
switches 0:0e018d759a2a 345
switches 0:0e018d759a2a 346 Total platforms: 90
switches 0:0e018d759a2a 347 Total permutations: 297
switches 0:0e018d759a2a 348 ```
switches 0:0e018d759a2a 349
switches 0:0e018d759a2a 350 Above list can be overwhelming so please do not hesitate to use switch ```-f``` to filter ```Platform``` column.
switches 0:0e018d759a2a 351 ```
switches 0:0e018d759a2a 352 $ python build.py -S -f ^K
switches 0:0e018d759a2a 353 +--------------+-----------+---------+-----------+-----------+--------+
switches 0:0e018d759a2a 354 | Platform | ARM | uARM | GCC_ARM | IAR | GCC_CR |
switches 0:0e018d759a2a 355 +--------------+-----------+---------+-----------+-----------+--------+
switches 0:0e018d759a2a 356 | K20D50M | Default | - | Supported | Supported | - |
switches 0:0e018d759a2a 357 | K22F | Default | - | Supported | Supported | - |
switches 0:0e018d759a2a 358 | K64F | Default | - | Supported | Supported | - |
switches 0:0e018d759a2a 359 | KL05Z | Supported | Default | Supported | Supported | - |
switches 0:0e018d759a2a 360 | KL25Z | Default | - | Supported | Supported | - |
switches 0:0e018d759a2a 361 | KL43Z | Default | - | Supported | - | - |
switches 0:0e018d759a2a 362 | KL46Z | Default | - | Supported | Supported | - |
switches 0:0e018d759a2a 363 | NRF51_DK | Default | - | Supported | Supported | - |
switches 0:0e018d759a2a 364 | NRF51_DK_OTA | Default | - | Supported | - | - |
switches 0:0e018d759a2a 365 +--------------+-----------+---------+-----------+-----------+--------+
switches 0:0e018d759a2a 366 *Default - default on-line compiler
switches 0:0e018d759a2a 367 *Supported - supported off-line compiler
switches 0:0e018d759a2a 368
switches 0:0e018d759a2a 369 Total platforms: 9
switches 0:0e018d759a2a 370 Total permutations: 28
switches 0:0e018d759a2a 371 ```
switches 0:0e018d759a2a 372 or just give platform name:
switches 0:0e018d759a2a 373 ```
switches 0:0e018d759a2a 374 $ python build.py -S -f LPC1768
switches 0:0e018d759a2a 375 +----------+---------+-----------+-----------+-----------+-----------+
switches 0:0e018d759a2a 376 | Platform | ARM | uARM | GCC_ARM | IAR | GCC_CR |
switches 0:0e018d759a2a 377 +----------+---------+-----------+-----------+-----------+-----------+
switches 0:0e018d759a2a 378 | LPC1768 | Default | Supported | Supported | Supported | Supported |
switches 0:0e018d759a2a 379 +----------+---------+-----------+-----------+-----------+-----------+
switches 0:0e018d759a2a 380 *Default - default on-line compiler
switches 0:0e018d759a2a 381 *Supported - supported off-line compiler
switches 0:0e018d759a2a 382
switches 0:0e018d759a2a 383 Total platforms: 1
switches 0:0e018d759a2a 384 Total permutations: 6
switches 0:0e018d759a2a 385 ```
switches 0:0e018d759a2a 386
switches 0:0e018d759a2a 387 * You can be more verbose ```-v``` especially if you want to see each compilation / linking command build.py is executing:
switches 0:0e018d759a2a 388 ```
switches 0:0e018d759a2a 389 $ python build.py -t GCC_ARM -m LPC1768 -j 8 -v
switches 0:0e018d759a2a 390 Building library CMSIS (LPC1768, GCC_ARM)
switches 0:0e018d759a2a 391 Copy: LPC1768.ld
switches 0:0e018d759a2a 392 Compile: startup_LPC17xx.s
switches 0:0e018d759a2a 393 [DEBUG] Command: C:/Work/toolchains/gcc_arm_4_8/4_8_2013q4/bin\arm-none-eabi-gcc
switches 0:0e018d759a2a 394 -x assembler-with-cpp -c -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers
switches 0:0e018d759a2a 395 -fmessage-length=0 -fno-exceptions -fno-builtin -ffunction-sections -fdata-sections -MMD
switches 0:0e018d759a2a 396 -fno-delete-null-pointer-checks -fomit-frame-pointer -mcpu=cortex-m3 -mthumb -O2
switches 0:0e018d759a2a 397 -DTARGET_LPC1768 -DTARGET_M3 -DTARGET_CORTEX_M -DTARGET_NXP -DTARGET_LPC176X
switches 0:0e018d759a2a 398 -DTARGET_MBED_LPC1768 -DTOOLCHAIN_GCC_ARM -DTOOLCHAIN_GCC -D__CORTEX_M3 -DARM_MATH_CM3
switches 0:0e018d759a2a 399 -DMBED_BUILD_TIMESTAMP=1424903604.77 -D__MBED__=1 -IC:\Work\mbed\libraries\mbed\targets\cmsis
switches 0:0e018d759a2a 400 -IC:\Work\mbed\libraries\mbed\targets\cmsis\TARGET_NXP
switches 0:0e018d759a2a 401 -IC:\Work\mbed\libraries\mbed\targets\cmsis\TARGET_NXP\TARGET_LPC176X -IC:\Work\mbed\libraries\mbed\targets\cmsis\TARGET_NXP\TARGET_LPC176X\TOOLCHAIN_GCC_ARM
switches 0:0e018d759a2a 402 -o C:\Work\mbed\build\mbed\.temp\TARGET_LPC1768\TOOLCHAIN_GCC_ARM\TARGET_NXP\TARGET_LPC176X\TOOLCHAIN_GCC_ARM\startup_LPC17xx.o
switches 0:0e018d759a2a 403 C:\Work\mbed\libraries\mbed\targets\cmsis\TARGET_NXP\TARGET_LPC176X\TOOLCHAIN_GCC_ARM\startup_LPC17xx.s
switches 0:0e018d759a2a 404 [DEBUG] Return: 0
switches 0:0e018d759a2a 405 ...
switches 0:0e018d759a2a 406 ```
switches 0:0e018d759a2a 407
switches 0:0e018d759a2a 408 ## CppCheck analysis
switches 0:0e018d759a2a 409 [Cppcheck](http://cppcheck.sourceforge.net/) is a static analysis tool for C/C++ code. Unlike C/C++ compilers and many other analysis tools it does not detect syntax errors in the code. Cppcheck primarily detects the types of bugs that the compilers normally do not detect. The goal is to detect only real errors in the code (i.e. have zero false positives).
switches 0:0e018d759a2a 410
switches 0:0e018d759a2a 411 Prerequisites:
switches 0:0e018d759a2a 412 * Please install ```CppCheck``` on your system before you want to use it with build scripts.
switches 0:0e018d759a2a 413 * You should also add Cppcheck to your system path.
switches 0:0e018d759a2a 414
switches 0:0e018d759a2a 415 ```build.py``` script supports switching between compilation, building and just static code analysis testing. You can use switch ```--cppcheck``` to perform CppCheck static code analysis.
switches 0:0e018d759a2a 416
switches 0:0e018d759a2a 417 * When you are using --cppcheck switch all macros, toolchain dependencies etc. are preserved so you are sure you are checking exactly the same code you would compile for your application.
switches 0:0e018d759a2a 418
switches 0:0e018d759a2a 419 * Cppcheck analysis can take up to few minutes on slower machines.
switches 0:0e018d759a2a 420
switches 0:0e018d759a2a 421 * Usually you will use switches ```-t``` and ```-m``` to define toolchain and MCU (platform) respectively. You should do the same in case of CppCheck analysis. Please note that build script can also compile and build RTOS, Ethernet library etc. If you want to check those just use corresponding build script switches (e.g. ```-r```, ```-e```, ...).
switches 0:0e018d759a2a 422
switches 0:0e018d759a2a 423 Example:
switches 0:0e018d759a2a 424 ```
switches 0:0e018d759a2a 425 $ python build.py -t uARM -m NUCLEO_F334R8 --cppcheck
switches 0:0e018d759a2a 426 ```
switches 0:0e018d759a2a 427
switches 0:0e018d759a2a 428 # make.py script
switches 0:0e018d759a2a 429 ```make.py``` is a ```mbed/tools/``` script used to build tests (we call them sometimes 'programs') one by one manually. This script allows you to flash board, execute and test it. However, this script is deprecated and will not be described here. Instead please use ```singletest.py``` file to build mbed SDK, tests and run automation for test cases included in ```mbedmicro/mbed```.
switches 0:0e018d759a2a 430 Note: ```make.py``` script depends on existing already built mbed SDK and library sources so you need to pre-build mbed SDK and other libraries (such as RTOS library) to link 'program' (test) with mbed SDK and RTOS library. To pre-build mbed SDK please use ```build.py``` script.
switches 0:0e018d759a2a 431
switches 0:0e018d759a2a 432 Just for sake of example please see few ways to use ```make.py``` together with Freedom K64F board.
switches 0:0e018d759a2a 433
switches 0:0e018d759a2a 434 * We need to build mbed SDK (in directory ```mbed/build/```:
switches 0:0e018d759a2a 435 ```
switches 0:0e018d759a2a 436 $ python build.py -t GCC_ARM -m K64F -j 8
switches 0:0e018d759a2a 437 Building library CMSIS (K64F, GCC_ARM)
switches 0:0e018d759a2a 438 Building library MBED (K64F, GCC_ARM)
switches 0:0e018d759a2a 439
switches 0:0e018d759a2a 440 Completed in: (0.59)s
switches 0:0e018d759a2a 441
switches 0:0e018d759a2a 442 Build successes:
switches 0:0e018d759a2a 443 * GCC_ARM::K64F
switches 0:0e018d759a2a 444 ```
switches 0:0e018d759a2a 445 * We can print all 'programs' (test cases) ```make.py``` can build for us:
switches 0:0e018d759a2a 446 ```
switches 0:0e018d759a2a 447 $ python make.py -L
switches 0:0e018d759a2a 448 .
switches 0:0e018d759a2a 449 [ 0] MBED_A1: Basic
switches 0:0e018d759a2a 450 [ 1] MBED_A2: Semihost file system
switches 0:0e018d759a2a 451 [ 2] MBED_A3: C++ STL
switches 0:0e018d759a2a 452 [ 3] MBED_A4: I2C TMP102
switches 0:0e018d759a2a 453 .
switches 0:0e018d759a2a 454 ```
switches 0:0e018d759a2a 455 For example 'program' under index ```2``` is ```MBED_A3``` test case we can build and flash onto K64F board.
switches 0:0e018d759a2a 456 * Building test with ```make.py``` by specifying test case name with ```-n``` option:
switches 0:0e018d759a2a 457 ```
switches 0:0e018d759a2a 458 $ python make.py -t GCC_ARM -m K64F -n MBED_A3
switches 0:0e018d759a2a 459 Building project STL (K64F, GCC_ARM)
switches 0:0e018d759a2a 460 Compile: main.cpp
switches 0:0e018d759a2a 461 [Warning] main.cpp@76: In function 'int main()': deprecated conversion from string constant to 'char*' [-Wwrite-strings]
switches 0:0e018d759a2a 462 .
switches 0:0e018d759a2a 463 .
switches 0:0e018d759a2a 464 .
switches 0:0e018d759a2a 465 [Warning] main.cpp@76: In function 'int main()': deprecated conversion from string constant to 'char*' [-Wwrite-strings]
switches 0:0e018d759a2a 466 Compile: test_env.cpp
switches 0:0e018d759a2a 467 Link: stl
switches 0:0e018d759a2a 468 Elf2Bin: stl
switches 0:0e018d759a2a 469 Image: C:\Work\mbed\build\test\K64F\GCC_ARM\MBED_A3\stl.bin
switches 0:0e018d759a2a 470 ```
switches 0:0e018d759a2a 471 Because we previously have built mbed SDK we are now able to drive test case compilation and linking with mbed SDK and produce ```MBED_A3``` test case binary in build directory:
switches 0:0e018d759a2a 472 ```
switches 0:0e018d759a2a 473 C:\Work\mbed\build\test\K64F\GCC_ARM\MBED_A3\stl.bin
switches 0:0e018d759a2a 474 ```
switches 0:0e018d759a2a 475
switches 0:0e018d759a2a 476 For more help type ```$ python make.py --help``` in your command line.
switches 0:0e018d759a2a 477
switches 0:0e018d759a2a 478 # project.py script
switches 0:0e018d759a2a 479 ```project.py``` script is used to export test cases ('programs') from test case portfolio to off-line IDE. This is a easy way to export test project to IDEs such as:
switches 0:0e018d759a2a 480 * codesourcery.
switches 0:0e018d759a2a 481 * coide.
switches 0:0e018d759a2a 482 * ds5_5.
switches 0:0e018d759a2a 483 * emblocks.
switches 0:0e018d759a2a 484 * gcc_arm.
switches 0:0e018d759a2a 485 * iar.
switches 0:0e018d759a2a 486 * kds.
switches 0:0e018d759a2a 487 * lpcxpresso.
switches 0:0e018d759a2a 488 * uvision.
switches 0:0e018d759a2a 489
switches 0:0e018d759a2a 490 You can export project using command line. All you need to do is to specify mbed platform name (option ```-m```), your IDE (option ```-i```) and project name you want to export (option ```-n``` or (option ```-p```).
switches 0:0e018d759a2a 491
switches 0:0e018d759a2a 492 In below example we export our project so we can work on it using GCC ARM cross-compiler. Building mechanism used to drive exported build will be ```Make```.
switches 0:0e018d759a2a 493 ```
switches 0:0e018d759a2a 494 $ python project.py -m K64F -n MBED_A3 -i gcc_arm
switches 0:0e018d759a2a 495 Copy: test_env.h
switches 0:0e018d759a2a 496 Copy: AnalogIn.h
switches 0:0e018d759a2a 497 Copy: AnalogOut.h
switches 0:0e018d759a2a 498 .
switches 0:0e018d759a2a 499 .
switches 0:0e018d759a2a 500 .
switches 0:0e018d759a2a 501 Copy: K64FN1M0xxx12.ld
switches 0:0e018d759a2a 502 Copy: main.cpp
switches 0:0e018d759a2a 503
switches 0:0e018d759a2a 504 Successful exports:
switches 0:0e018d759a2a 505 * K64F::gcc_arm C:\Work\mbed\build\export\MBED_A3_gcc_arm_K64F.zip
switches 0:0e018d759a2a 506 ```
switches 0:0e018d759a2a 507 You can see exporter placed compressed project export in ```zip``` file in ```mbed/build/export/``` directory.
switches 0:0e018d759a2a 508
switches 0:0e018d759a2a 509 Example export file ```MBED_A3_gcc_arm_K64F.zip``` structure:
switches 0:0e018d759a2a 510 ```
switches 0:0e018d759a2a 511 MBED_A3
switches 0:0e018d759a2a 512 ├───env
switches 0:0e018d759a2a 513 └───mbed
switches 0:0e018d759a2a 514 ├───api
switches 0:0e018d759a2a 515 ├───common
switches 0:0e018d759a2a 516 ├───hal
switches 0:0e018d759a2a 517 └───targets
switches 0:0e018d759a2a 518 ├───cmsis
switches 0:0e018d759a2a 519 │ └───TARGET_Freescale
switches 0:0e018d759a2a 520 │ └───TARGET_MCU_K64F
switches 0:0e018d759a2a 521 │ └───TOOLCHAIN_GCC_ARM
switches 0:0e018d759a2a 522 └───hal
switches 0:0e018d759a2a 523 └───TARGET_Freescale
switches 0:0e018d759a2a 524 └───TARGET_KPSDK_MCUS
switches 0:0e018d759a2a 525 ├───TARGET_KPSDK_CODE
switches 0:0e018d759a2a 526 │ ├───common
switches 0:0e018d759a2a 527 │ │ └───phyksz8081
switches 0:0e018d759a2a 528 │ ├───drivers
switches 0:0e018d759a2a 529 │ │ ├───clock
switches 0:0e018d759a2a 530 │ │ ├───enet
switches 0:0e018d759a2a 531 │ │ │ └───src
switches 0:0e018d759a2a 532 │ │ ├───interrupt
switches 0:0e018d759a2a 533 │ │ └───pit
switches 0:0e018d759a2a 534 │ │ ├───common
switches 0:0e018d759a2a 535 │ │ └───src
switches 0:0e018d759a2a 536 │ ├───hal
switches 0:0e018d759a2a 537 │ │ ├───adc
switches 0:0e018d759a2a 538 │ │ ├───can
switches 0:0e018d759a2a 539 │ │ ├───dac
switches 0:0e018d759a2a 540 │ │ ├───dmamux
switches 0:0e018d759a2a 541 │ │ ├───dspi
switches 0:0e018d759a2a 542 │ │ ├───edma
switches 0:0e018d759a2a 543 │ │ ├───enet
switches 0:0e018d759a2a 544 │ │ ├───flextimer
switches 0:0e018d759a2a 545 │ │ ├───gpio
switches 0:0e018d759a2a 546 │ │ ├───i2c
switches 0:0e018d759a2a 547 │ │ ├───llwu
switches 0:0e018d759a2a 548 │ │ ├───lptmr
switches 0:0e018d759a2a 549 │ │ ├───lpuart
switches 0:0e018d759a2a 550 │ │ ├───mcg
switches 0:0e018d759a2a 551 │ │ ├───mpu
switches 0:0e018d759a2a 552 │ │ ├───osc
switches 0:0e018d759a2a 553 │ │ ├───pdb
switches 0:0e018d759a2a 554 │ │ ├───pit
switches 0:0e018d759a2a 555 │ │ ├───pmc
switches 0:0e018d759a2a 556 │ │ ├───port
switches 0:0e018d759a2a 557 │ │ ├───rcm
switches 0:0e018d759a2a 558 │ │ ├───rtc
switches 0:0e018d759a2a 559 │ │ ├───sai
switches 0:0e018d759a2a 560 │ │ ├───sdhc
switches 0:0e018d759a2a 561 │ │ ├───sim
switches 0:0e018d759a2a 562 │ │ ├───smc
switches 0:0e018d759a2a 563 │ │ ├───uart
switches 0:0e018d759a2a 564 │ │ └───wdog
switches 0:0e018d759a2a 565 │ └───utilities
switches 0:0e018d759a2a 566 │ └───src
switches 0:0e018d759a2a 567 └───TARGET_MCU_K64F
switches 0:0e018d759a2a 568 ├───device
switches 0:0e018d759a2a 569 │ ├───device
switches 0:0e018d759a2a 570 │ │ └───MK64F12
switches 0:0e018d759a2a 571 │ └───MK64F12
switches 0:0e018d759a2a 572 ├───MK64F12
switches 0:0e018d759a2a 573 └───TARGET_FRDM
switches 0:0e018d759a2a 574 ```
switches 0:0e018d759a2a 575
switches 0:0e018d759a2a 576 After unpacking exporter ```zip``` file we can go to directory and see files inside MBED_A3 directory:
switches 0:0e018d759a2a 577 ```
switches 0:0e018d759a2a 578 $ ls
switches 0:0e018d759a2a 579 GettingStarted.htm Makefile env main.cpp mbed
switches 0:0e018d759a2a 580 ```
switches 0:0e018d759a2a 581 Exporter generated for us ```Makefile``` so now we can build our software:
switches 0:0e018d759a2a 582 ```
switches 0:0e018d759a2a 583 $ make -j 8
switches 0:0e018d759a2a 584 .
switches 0:0e018d759a2a 585 .
switches 0:0e018d759a2a 586 .
switches 0:0e018d759a2a 587 text data bss dec hex filename
switches 0:0e018d759a2a 588 29336 184 336 29856 74a0 MBED_A3.elf
switches 0:0e018d759a2a 589 ```
switches 0:0e018d759a2a 590
switches 0:0e018d759a2a 591 We can see root directory of exporter project is now populated with binary files:
switches 0:0e018d759a2a 592 * MBED_A3.bin.
switches 0:0e018d759a2a 593 * MBED_A3.elf .
switches 0:0e018d759a2a 594 * MBED_A3.hex.
switches 0:0e018d759a2a 595 You have also map file ```MBED_A3.map``` for your disposal.
switches 0:0e018d759a2a 596 ```
switches 0:0e018d759a2a 597 $ ls
switches 0:0e018d759a2a 598 GettingStarted.htm MBED_A3.bin MBED_A3.elf MBED_A3.hex MBED_A3.map Makefile env main.cpp main.d main.o mbed
switches 0:0e018d759a2a 599 ```
switches 0:0e018d759a2a 600