Mbed OS 2 and Mbed OS 5
This is the handbook for Mbed OS 2. If you’re working with Mbed OS 5, please see the new handbook.
Please note, changing the compiler toolchain introduces many degrees of freedom in the system; these differences include the translation of C/C++ code to assembly code, the link time optimizations, differences because of the implementations of the C standard libraries, and differences based on compile and link options. It also makes it a lot harder to share code and questions with other developers, as the context needs to be shared too!
Whilst we support exporting your project and the libraries to an alternate toolchain, we cannot guarantee the same consistency as using the mbed Online Compiler. We will do our best to maintain the exported libraries, project file and makefiles, but please understand we can not cover all cases, combinations or provide support for use of these alternate tools themselves!
Eclipse is a widely-used, open source IDE that supports multiple languages. It is used by many offline toolchains, including LPCXpresso and Kinetis Design Studio. The setup process for each IDE will vary depending on the distribution; however, the user interface between these distributions will not change much, so these instructions should be easy to apply to all Eclipse-based IDEs.
For a complete overview of the "export" feature, please refer to our general: Exporting to offline toolchains.
To export your mbed program for use in an Eclipse-based IDE, right-click the program in your program workspace. From the dialog, you can select your desired toolchain for the "Export Toolchain" field. Also, be sure to select the correct target platform under the "Export Target" field.
When you choose export, a zip file containing all the files you need will be generated. Unzip it anywhere and open your Eclipse-based IDE.
NOTE: All of the following screenshots will be using a plain Eclipse IDE installation with no embedded development plugins installed. This was done to keep these instructions as general as possible. Your IDE's user interface will most likely not match the following screenshots exactly, but it should be very similar.
Click File > Import…
In the dialog that pops up, under “General”, select “Existing Projects into Workspace” and click Next.
Next to the “Select root directory” field, click Browse. In the dialog that pops up, navigate to where you unzipped the downloaded program and select the folder. Hit “OK”.
In the “Projects” area, you should see the project name listed. Ensure the checkbox next to it is checked. Hit “Finish”.
Now your project should appear in the "Project Explorer" on the left side of the IDE.
After the build, your binary will be generated in the "Release", or "Debug" directory, depending on the selected configuration.