Use an external Toolchain with Embedded Studio

From SEGGER Wiki
Jump to: navigation, search

Embedded Studio offers the option to build project with an external GNU toolchain of your choice. The following guide will show an example implementation of such a setup with the ARM GCC toolchain.

Example implementation with external GCC toolchain

  • First install the external toolchain of your liking, in this example the currently latest ARM GCC 7-2017-q4-major will be used.
  • Create a new externally build project using the Embedded Studio project wizard and selecting A C/C++ executable for ... processor executing from ...(internal and external GNU tools).

Note: You can choose between setting up a RAM or Flash sample that way

New external build project
  • Select your target device, next set the toolchain path and finish the project setup by letting all settings on default.
  • Make sure the memory section placement segments are located in the correct memory areas. This can be found int he Common project settings under Linker-> Section Placement Segments
  • Now select build configuration "Debug External" and build the project to build with the external toolchain.
  • If the build succeeds you can download it into your target application and debug it.

Optional steps for more complex builds

When adding more complex projects to Embedded Studio as an external build usually additional steps are required to make full use of the external compiler. The following are the most common:

  • Preprocessor definitions: Under Preprocessor->Preprocessor Definitions in the external build configs missing preprocessor definitions can be set.
  • User include directories: Under Preprocessor->User Include Directories in the external build configs missing include directories can be added.
  • All other commands that can't be set directly through the Embedded Studio GUI need to be set manually to the external build command line which can be found under External Build in one of the external build project configurations.

Alternative steps for external build tools like make

The example above explains how the Embedded Studio GUI can be used to build a project with an external gcc toolchain. However if you plan on using e.g. make to call the external toolchain directly additional steps are required.

Internal and External build project template

This template is selected in the guide above as well. In such case you must make sure that all project options that can be found under Code > External Build in the "External GNU" build config must be set to none. Next set the option Code > External Build > Build Command to contain the complete e.g. make build command call.

External only build project template

Should you select the external build only template from the project wizard all "External Build" project options are already set to none. Here all that is needed that the option Code > External Build > Build Command contains the complete e.g. make build command call.