Skip navigation

Tool chain and Compiler

  • All tools included
  • Ready-to-run
  • GCC and LLVM
  • Support for external tool chains

Embedded Studio comes with the pre-built, ready-to-run compiler toolchains GCC and LLVM for an immediate start. Once your project is created, it is ready to be built and ran. Embedded Studio also includes roalty-free ANSI / ISO C compliant C /C++ libraries for input and output using the C standard functions printf and scanf.  The C libraries are developed and optimized for embedded applications.

Embedded Studio comes with two tool chains. Both tool chains are free software, developed and improved over years, and field-proven. They can produce equally fast or small code as commercial products.

Why two tool chains? Both, GCC and LLVM, produce good quality code. They are developed by independent teams and communities and use different techniques, for example for speed optimization. Which one produces the smallest or fastest code, depends on the target application. Therefore Embedded Studio includes both tool chains. To provide you with the best tools for your project.

A C Library for embedded applications

Most GCC based projects use Newlib or its smaller version Newlib nano as the standard C Library. Newlib has been created for full-featured computers with lots of memory. Even Newlib nano might require a lot of stack and even heap for functions, such as printf.

Embedded Studio comes with its own standard C Library. The library has been created from scratch, tailored and optimized for embedded applications, to be used on even the smallest micros.

Embedded Studio automatically chooses the suitable library

Embedded Studio automatically chooses the suitable library for your device architecture and provides additional settings to switch between different library configurations which may be optimized for size, speed or functionality.

Building your project

Choose the configuration you want to build and select Build ➜ Build <project> (F7) or right-click on your project and select "Build". You can also build your whole solution by selecting Build ➜ Build Solution.

Embedded Studio starts the build process. The progress is shown in the output window.When building the whole Solution with projects which are not dependent you can see multiple progress bars. Embedded Studio can build projects in parallel to speed up the build process.

Successful Builds

When all errors are corrected your project can successfully be built. The output window will show that building the projects is completed. If there were warnings during compilation the status indicator on the right will show the number of warnings. Otherwise it will show 'OK'. If you are building an application you can see the memory usage of your application.

Compile and Linkage Errors

If an error occurs while compiling or linking your application the build process is stopped. The output window will show the errors and the editor is set to the first occurred error. You can go through your project and correct the errors by double-clicking on the error in the output window or pressing F4 to go to the next error or warning. 
You can also manually search for errors. All errors and warnings are marked in the source code. On mouse-over on the error or warning icon you can see the compiler message.
When all errors are corrected build your project again.

Using printf in your Application

When creating a new project with Embedded Studio input and output functions can immediately be used. By default Embedded Studio Projects are configured to use the SEGGER Real Time Terminal (RTT) module to send output from the application to the Debugger. With RTT it is possible to send and receive data at high speeds without stopping the target or affecting any real-time behavior of the application. Output sent via RTT will be directly displayed in the debug terminal in Embedded Studio.

Customizing Output

To use printf, putchar and puts in your application you can also choose other ways to display output. For example send output via UART or show it on a display. To do this you need to customize how characters are presented. This is done by supplying the function __putchar in your application.

Prototype:    int __putchar(int c);
Parameter:    c: The character which shall be shown.
Return Value: The character which was written or -1 on error.

Example Implementation

#include "SEGGER_RTT.h"
int __putchar(int x) {
  SEGGER_RTT_Write(0, (char *)&x, 1); return x;
}