External toolchains
Embedded Studio supports the use of external toolchains, such as the compilers from IAR and Keil. The feature allows building with the external compiler while at the same time allowing developers to take advantage of the superior Embedded Studio IDE features of managing projects and advanced debugging capabilities.
Overview
Embedded Studio - GCC, LLVM, IAR and Keil under one roof
With external toolchain support, Embedded Studio can simply build your project on the original toolchain it has been created for. You can continue to build with the former tools while seamlessly migrating to Embedded Studio. After migration you can completely switch to the internal toolchains or continue to build releases with the original toolchain and use the internal toolchain for development only.
Key features
- Support for external toolchains
- Multi-toolchain build configurations
- Easy migration to internal toolchains
- Project importer for common IDEs
Import existing projects to Embedded Studio
A detailed description on how to port from IAR to Embedded Studio can be found in our Wiki.
Quick start guide: Existing IAR Embedded Workbench and Keil uVision projects can easily be imported with Embedded Studio.
Go to File -> Import IAR EWARM / Keil MDK Project... and select the project file to import.
The Project Importer allows to choose the build configurations to create. Additionally the external toolchain path can be set.
- External Toolchain imports the project and configures it to be built with the original toolchain.
- Internal Toolchain imports the project and sets the configuration for the Embedded Studio toolchain.
- Internal and External Toolchains create a set of build configurations to build with the original toolchain and one set to build with the Embedded Studio toolchain.
- To migrate to Embedded Studio it is recommended to create build configurations for internal and external toolchains.
The Project Importer creates the new Embedded Studio project from the imported project and shows a status message.
Building the project with the external toolchain: To build the project with the external toolchain, choose a build configuration suffixed External, i.e. Debug External.
Embedded Studio builds the project using the external toolchain (e.g. the IAR compiler). The output will be the same as compiled with the former IDE.
To build the project with the Embedded Studio toolchain, choose a build configuration suffixed Internal, i.e. Debug Internal.
Embedded Studio builds the project using its toolchain (GCC). If the project does not build out-of-the-box refer to the next section Migration guide to check what might need to be changed.
Migration guide
While imported projects will re-built with the external toolchain out-of-the-box, for GCC (and LLVM) based project build configurations, some manual changes may be required. In some cases the sources are created to be GCC compatible, then you can seamlessly switch between original toolchain and GCC. When the original project is created from a software pack or SDK, it might already come with GCC compatible source files which can replace the former toolchain compatible files.
The following section lists the most common changes which are required to migrate a project to Embedded Studio. If you are missing any instructions or have trouble importing your project to Embedded Studio, contact us at info@segger.com.
Most common source changes
Linker Script: The Embedded Studio project importer does not import linker scripts (e.g. IAR icf files). It sets up the basic memory map for the selected target device, which will put code into the internal flash and data into the internal SRAM.
For more advanced or different configurations, the memory map file and the section placement file have to be set up accordingly.
Third-party software and libraries
Third-party software, especially libraries, might be configured for one toolchain and do not compile with other toolchains.
Check if there is a port of the software for Embedded Studio / GCC or configure and rebuild the software for Embedded Studio / GCC.
Although libraries built for another toolchain may link with Embedded Studio, always take care and check that interfacing with the library works as expected.
Assembly files and inline assembly
The syntax of assembler code and control commands in assembler files can be different across toolchains.
Although the resulting assembled instructions are identical, the assembler code to be written can be different across toolchains, for example numerical constants need to be declared differently for IAR and GCC.
Control commands which help writing assembler code is different, too. The syntax for symbols, labels, function definitions, and alike needs to be adjusted to work with the GNU assembler.
Preprocessor defines
Toolchains use different built-in definitions to identify the compiler which is used and to allow conditional compilation based on the configuration of core, device, endianess, and other settings.
It is mandatory to choose the correct definitions and recommended to make sure the code throws a warning or error when required definitions are not defined.
IAR defines __ICCARM__ and __IAR_SYSTEMS_ICC__ which can be used for identification, Embedded Studio defines __SES_ARM and __GNUC__.
For the target device IAR defines __ARM7M__ and __CORE__=__ARM7M__ when compiling for Cortex-M4, Embedded Studio uses __ARM_ARCH_7M__ instead.
Toolchain intrinsics: Compiler-specific functions like __disable_interrupt() might not be available in Embedded Studio. Write corresponding replacement functions or avoid using them at all.
Why should I switch to Embedded Studio?
Embedded Studio is an industry leading streamlined and powerful IDE. It is specifically designed for professional embedded development: an all-in-one solution providing stability and a continuous workflow.
What is the Difference to Other IDEs?
- Embedded Studio is created by embedded developers for embedded developers! Software teams at SEGGER use Embedded Studio for all production grade SEGGER software. They supplement the Embedded Studio development, share their experience, and provide feedback and requirements for a 'perfect' embedded development IDE.
- Embedded Studio's intuitive user interface is easy to use, works on any PC, MAC or Linux platform and supports all ARM microcontroller devices, including new V8M variants.
- Embedded Studio's licensing: The purchase of an Embedded Studio license (associated with your J-Link) entitles the user to install and use all Embedded Studio versions which will have been released within the Support and Update period for an unlimited usage period. To use a version of Embedded Studio after the Support and Update period no license renewal is required.
- Embedded Studio's download footprint is small with a straight forward, super fast, no fuss, installation. With Embedded Studio there are never feature restrictions or code size limitations, it is a full featured IDE out-of-the-box.
- With Embedded Studio the complete tooling source code is available so there is no dependency on the supplier. In addition the Embedded Studio IDE can be used without limitation even when used in "evaluation mode" - non commercial license model.
Is Embedded Studio a professional IDE?
Absolutely. Embedded Studio is created as a professional all-in-one solution to be used from system concept to production. Embedded Studio supports Thread awareness, trace and much more.
What about the compiler?
Embedded Studio comes with the two free toolchains, GCC and LLVM, which are perfectly suitable to create professional, high-quality code. The code quality produced by GCC or LLVM/Clang is on a par with commercial compilers.
Media: Project Importer
This short video shows the steps needed to import an external IAR project into Embedded Studio IDE