Getting your program on your board
The Arm Mbed Online Compiler builds a file that can run on your board. All you need to do is:
- Select the correct board.
- Compile the code and download the compiled file.
- Copy the file to your board.
Selecting your board
Mbed programs can be built to run on multiple boards. The hard work is done behind the scenes by Arm Mbed OS itself. All you need to do is tell the Mbed Online Compiler which board you're building for.
To select a board as the build target:
-
The compiler shows the current build board's name on the upper right corner:
Showing current board. Click the board to open the full list
-
Click the name of the board you need:
Click a board to set it as the compilation board
If the board isn't already on your list, go to the board's page on
mbed.com
and click theAdd to your mbed Compiler
button:Adding a board to the Mbed Online Compiler list
Compiling and downloading
The Compile menu offers five options:
- Compile: builds code that you have modified since your last compile and downloads the built binary file to your default download location.
- Compile All: same as compile, but rebuilds all source code, even if it hasn't changed since the last compile. Downloads the built binary file to your default download location.
- Build Only: compiles your code but doesn't download the result.
- Compile Macros: defines additional macros at compile time.
- Update Docs: adds documentation.
Copying the file to the board
To run your program on the board:
- Connect your board to the computer over USB. It appears on your computer as removable storage.
- Navigate to your default download location. If the build has completed, your binary should be in this folder.
- Drag and drop the binary file to the board.
The device appears as removable storage, under the name MBED
Note: If you're working on Windows 7, you might need to install a driver to allow you to copy to your board. Please see the Windows Serial Driver section.