logo slogan

Segger Embedded Studio: Compiler

SES
SEGGER Embedded Studio is a streamlined and powerful C/C++ IDE (Integrated Development Environment) for ARM microcontrollers.

 

SEGGER Embedded Studio comes with the pre-built, ready-to-run compiler tool-chains GCC and LLVM for an immediate start. Once your project is created, it is ready to be built and ran.


SEGGER 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. SEGGER 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 Name> (F7) or right-click on your project and select "Build". You can also build your whole solution by selecting Build ➜ Build Solution.
SEGGER 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. SEGGER Embedded Studio can build projects in parallel to speed up the build process.


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.


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.

 

 

Using printf in your Application


When creating a new project with SEGGER Embedded Studio input and output functions can immediately be used. By default SEGGER 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 behaviour of the application. Output sent via RTT will be directly displayed in the debug terminal in SEGGER 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.

 

#include "SEGGER_RTT.h"

int __putchar(int x) {
SEGGER_RTT_Write(0, (char *)&x, 1);
return x;
}