Mistake on this page? Email us

Getting started with Mbed Studio

To use Mbed Studio you must be logged in to your Mbed account. If you do not have an account, create one here.

Opening a workspace

When you install Mbed Studio, a workspace (Mbed Programs) is created for you in your home directory. Your workspace is the location in your file system that contains your Mbed programs, both imported and created. Each Mbed program is added as a child directory within your workspace.

To set a different folder as your workspace, open the File menu and select Open Workspace.... This option enables you to open Mbed programs that exist in other locations on disk.

The Open Recent Workspace... option allows you to use programs from a recently opened workspace.

Creating or importing programs

You can create a new Mbed program or import Mbed programs from os.mbed.com/code or Git hosting services such as GitHub, GitLab or Bitbucket. Alternatively, you can also import existing programs available on your file system or import programs exported from the Mbed Online Compiler.

Once your program has been created or imported, use the files pane to explore the program. Files are opened as separate tabs in the editor.

Note: Programs imported from os.mbed.com are Mercurial repositories.

Creating a new empty program or using an example program available in Mbed Studio

To create a new program:

  1. Open the File menu and select New Program....

  2. To create a new Mbed program with no content other than Mbed OS, select empty Mbed OS program. To import an example program to get started more quickly, select a program from the drop-down list.

  3. In the Program Name field, edit the name of the new program or keep the name provided by default.

  4. By default, the newly created program is made the active program. Build, run and debug commands only apply to the active program. Clear the checkbox if you do not want to make the new program active.

  5. Click Add Program. The program is created in your workspace.

Tip: An Mbed OS program must include mbed-os.lib. When you create a new program, Mbed Studio automatically checks mbed-os.lib and fetches the version of Mbed OS.

If you cannot find the example program you need in Mbed Studio, you can go to directly to os.mbed.com/code and look for examples. Once you have found the program you want to use, select the program then click the Export to desktop IDE button on the right (you will then need to choose a target and toolchain) or download the repository as a zip file. Finally, unzip the file and copy/paste the unzipped folder in your workspace.

Importing a program from a URL in Mbed Studio

To import a program from a URL:

  1. Open the File menu and select Import Program... to import a program from os.mbed.com/code or a Git hosting service.
  2. Paste the full URL of the relevant web page and edit the program name as required.
  3. By default, the newly created program is made the active program. Build, run and debug commands only apply to the active program. Clear the checkbox if you do not want to make the new program active.
  4. Click Add Program. The program is imported with the relevant version of Mbed OS.

Tip: If you have imported a program from os.mbed.com or a Git hosting service, Mbed Studio clones the repository. You can push changes back to the remote repository from Mbed Studio. For more information, see Working with source control.

Importing a program from your file system

To import a program from your file system: Copy the program to your Mbed Studio workspace (Mbed Programs). If you would like to set a different folder as your workspace, use the Open Workspace... option.

If you use the Mbed CLI, then you can use the Open Workspace... option to point at the location where you keep your programs. If you have a local .mbed file per program, then Mbed Studio will use it.

Importing a program from the Mbed Online Compiler

To import a program exported from the Mbed Online Compiler:

  1. From the Mbed Online Compiler, export your program as a zip file specifying the export target.
  2. Unzip the file and copy/paste the unzipped folder in your workspace. You can then download the source for any referenced libraries in your program.
  3. To download the source for libraries, ensure your program is set to active by right-clicking on your program and selecting Set Active Program, then select Download Source for Libraries. This will remove folders containing libraries in your program if they exist and automatically download the latest libraries available using the information contained in the {library_name}.lib file or files included in your program.

Developing with Mbed OS 5

Mbed Studio includes syntax highlighting for C/C++. To navigate your code, hold CMD or CTRL and click a variable, function name or class.

Mbed OS supports a wide range of platforms, and includes platform-specific information, such as pinout details and available features. For this reason, the full set of code editing features is only available if a platform has been set. Search and select a platform from the Target drop-down list in the files pane. Alternatively, connect a board to your computer with a USB adapter: Mbed Studio prompts you to set the platform for the active program.

You can add a target to the drop-down list by updating the target in the targets.json file, as described in Adding and configuring targets. The targets.json file is located in the mbed-os/targets folder of your program.

Set the platform for the active program from the files pane.

For more information about code editing in Mbed Studio see IntelliSense code editing. See also the Reference documentation for more information about the features of Mbed OS.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.