Skip to main content
  • Products
  • Evaluate our Software
  • Downloads
  • Free Utilities
  • Purchase
  • Support
  • About Us
  • Blog
  • Forum
  • Search
    • Contact Us
    • Forum
    • Wiki
    • Web Shop
    • Newsletter
    • RSS
  •  Jobs
  •  Blog
  • SEGGER Runtime Library
  • Technology
SEGGER - Runtime Library Product Icon

SEGGER Runtime Library

Optimized for embedded systems.

  • High performance, with time-critical routines written in assembly language
  • Significant code size reduction
  • Configurable for high speed or small size
  • Includes SEGGER's optimized Floating-Point Library emFloat
  • Designed for use with various toolchains
  • EABI compatible functions
  • Minimum RAM usage
  • No heap requirements
  • No viral licensing, no attribution clause

 Request Quote

  1. 1.What is the SEGGER Runtime Library?
  2. 2.Optimized Floating-Point Library
  3. 3.Variants
  4. 4.Memory Requirements
  5. 5.Performance
  6. 6.Library Verification
  7. 7.How to use the SEGGER Runtime Library

Most toolchains using GCC also use either newlib, newlib-nano or glibc. Unfortunately, these libraries have significant disadvantages over professional runtime libraries for embedded systems.

This is where the SEGGER Runtime Library comes in. It can be used with GCC, LLVM, and other toolchains to provide a runtime library designed and architected for embedded systems.

  • Requires no heap or memory management.
  • Reduces RAM usage.
  • Reduces ROM usage.
  • Significantly improves performance.
  • Contains no viral licensing or attribution clause.

What is the SEGGER Runtime Library?

The SEGGER Runtime Library is a complete C runtime library to be used with any toolchain. It  converts any GCC-based toolchain into a professional development choice. The SEGGER Runtime Library is used in SEGGER's Embedded Studio IDE and has proven its value for years.

The SEGGER Runtime Library has been designed and written from the ground up for embedded devices to enable high optimization with low requirements.

  • Significant code size reduction (typically around 5 kB)
  • High performance, with time-critical routines written in assembly language
  • Highly optimized functions that, when used, don't cause the inclusion of many additional support functions (e.g. printf)
  • Formatted input and output functions are customizable from basic I/O to fully featured I/O, enabling reduction of final code footprint
  • Full support for localization, UTF-8, code pages, and locale codecs is linked only if used

In many cases, the ROM-savings of the SEGGER Runtime Library enable the use of a smaller microcontroller with less on-chip memory. This can result in significant cost savings, especially for devices built in large quantities for the mass market.

Being a simple replacement for libraries, such as newlib or newlib-nano, the SEGGER Runtime Library shrinks and accelerates embedded applications. Whether the main concern with newlib is flash size, performance, or the attribution clause of the viral licensing, the SEGGER Runtime Library is the solution.

Optimized Floating-Point Library

The SEGGER Runtime Library contains emFloat, a complete, fully optimized and verified floating-point library, which is required for devices without an FPU.

The floating-point emulator, a crucial part of the floating-point library, are written in assembly language for different target architectures, optimized either for small code size or increased execution speed.

More about emFloat

Variants

The SEGGER Runtime Library can be licensed in source code to individual companies as well as to be included as libraries by providers of toolchains.

  • Source code makes it possible to step through library functions
  • Many functions can be tuned with different implementations for size-optimized code and speed-optimized code

The SEGGER Runtime Library is available in generic "C" code to run on any system. Additionally assembly optimized variants are available for:

  • ARM (Cortex-M and Cortex-A 32-bit)
  • RISC-V (RV32M)

Ports for other CPUs can be made available on request. If you are interested, please contact us for more information.

Memory Requirements

The SEGGER Runtime Library offers significant savings in flash memory. This is due to some functionality being written in assembly language, but primarily due to a structure that minimizes library internal dependencies, for example the file I/O not being linked in with printf() or scanf().

The SEGGER Runtime Library also uses less static RAM due to a structure designed from the ground up for embedded systems.

Benchmark Code:

int main(void) {
  printf("Hello World.\n");
  return 0;
}

SEGGER did some benchmarking on the SEGGER Runtime Library using NXP’s MCUXpresso as a representative IDE that might benefit from using the SEGGER RunTime Library. The benchmark consists of a simple "printf()" with output to a debug terminal. We compared the results for the SEGGER Runtime Library with the results for three other C libraries (Newlib, Newlib-nano, and Redlib). In each case, printf() was configured for the smallest possible size (size-optimized libraries, no floating point...). We then also tested with our own IDE, Embedded Studio, with the same code, using the SEGGER Runtime Library, in one case using the GNU Linker, in another case using the SEGGER Linker. 

Test EnvironmentTest project: Simple "main" project with "printf()"
ROM UsageRAM Usage
MCUXpresso1, Newlib31888 bytes2864 bytes
MCUXpresso, Redlib9940 bytes728 bytes
MCUXpresso, Newlib-nano9552 bytes416 bytes
MCUXpresso, SEGGER RunTime Library4392 bytes184 bytes
Embedded Studio2, SEGGER RunTime Library, GNU Linker2502 bytes0 bytes
Embedded Studio, SEGGER RunTime Library, SEGGER Linker1868 bytes0 bytes
Embedded Studio, SEGGER RunTime Library, SEGGER Linker, Host Formatting818 bytes8 bytes


1: MCUXpresso IDE v3.1.0-2200 and SDK 2.5.0 for the Freedom K66F board
2: Embedded Studio 4.16 with the Kinetis K60 CPU Support Package v1.02

Performance

The performance of a runtime library can have a huge impact on the speed of your application. You might actively use or try to avoid library functions, such as sprintf(), memcpy(), memcmp(), .... But especially when dealing with floating point or 64-bit operations, the compiler will make you call library functions, such as for division and multiplication, that you do not see. Here the choice of the right runtime library can make the difference.

The SEGGER Runtime Library uses improved, highly advanced low-level implementations for such operations, which can be tuned for speed or size. With the assembly optimized variants, performance can be even more optimized by using the target platform to its full potential.

Library Verification

To verify the correct functionality of the SEGGER Runtime Library, we created and used our verification test suite. It checks the entire functionality of all library functions, including the entire floating point library with all corner cases.

More than 450 different tests with millions of test cases are executed. Below an exert for just a single test for sys_float64_add(), adding 64-bit doubles:

IEEE-754 Floating-point Library Tests
Copyright (c) 2018-2019 SEGGER Microcontroller GmbH.

sys_float64_add:
  0 failures (47256 tests)

Totals:
  0 failures (47256 tests)

If you are interested in replaying our results, or if you want to verify the library you currently use, or if you are going to develop your own runtime library, you can get the SEGGER Runtime Library Verification Test Suite.

How to use the SEGGER Runtime Library

The SEGGER Runtime Library can be used with any GCC-based IDE/toolchain by replacing the runtime library delivered with that toolchain (usually newlib, newlib-nano, or some other variant) with the SEGGER Runtime Library.

Examples include:

  • AC6 System Workbench for STM32 (SW4STM32)
  • Atmel Studio 7
  • Atollic TrueStudio for STM32
  • NXP MCUXpresso
  • Renesas e2 studio (for Synergy or RZ targets)
  • SiLabs Simplicity Studio

In SEGGER Embedded Studio and Rowley CrossWorks, the SEGGER Runtime Library is already included as the default C library.

The SEGGER Runtime Library is provided in source code and contains everything needed.

We recommend keeping the SEGGER Runtime Library separate from your application files. It is good practice to keep all the associated program files (including the header files) together in the LIB subdirectory of your project’s root directory. This practice has the advantage of being very easy to update to newer versions of the SEGGER Runtime Library by simply replacing the LIB directory. Your application files can be stored anywhere.

Please make sure that the list of included directories in your project contains the LIB directory and that any other runtime libraries are removed from the project.

Include "__libc.h" in any application source files that make calls to the SEGGER Runtime Library.

You will also need to implement functions like __assert(), __putchar(), and __getchar() in your project according to your needs before the project will build correctly. 

The SEGGER Runtime Library is exposed to the user by a set of header files that provide an interface to the library. The actual implementation is done in a small number of C source and Assembly files that must be added to your project before building.

The configuration of the SEGGER Runtime Library is defined by the content of __libc_conf.h, which is included by all C and assembly language source files.

Please see the SEGGER Runtime Library User Guide for details.

More Information

Purchase

  • Pricing

Technology

  • SEGGER Floating-Point Library

About us

  • The Company
  • Partners
  • Job Offers
  • Media
  • Contact us

Support

  • Technical Support
  • Blog
  • Forum
  • Wiki

Downloads

  • Application Notes
  • Embedded Studio
  • embOS
  • emCompress
  • emCrypt
  • emFile
  • emLib
  • emLoad
  • emModbus
  • emNet
  • emPower
  • emSecure
  • emSSH
  • emSSL
  • emUSB-Device
  • emUSB-Host
  • emWin
  • Flasher
  • Free Utilities
  • IoT
  • J-Link / J-Trace
  • SystemView
  • CE / REACH

Social Media

Headquarters

SEGGER Microcontroller GmbH

Ecolab-Allee 5
40789 Monheim am Rhein, Germany
info@segger.com
Tel.: +49-2173-99312-0
Fax: +49-2173-99312-28

Locations

USA: SEGGER Microcontroller Systems LLC

Boston area
101 Suffolk Lane
Gardner, MA 01440, USA
us-east@segger.com
Tel.: +1-978-874-0299
Fax: +1-978-874-0599

Silicon Valley
Milpitas, CA 95035, USA
us-west@segger.com
Tel.: +1-408-767-4068

China: SEGGER Microcontroller China Co., Ltd.

Room 218, Block A, Dahongqiaoguoji
No. 133 Xiulian Road
Minhang District, Shanghai 201199, China
china@segger.com
Tel.: +86-133-619-907-60

ISO 9001 certified

ISO 9001

28+ years of experience

28+ years of experience
  • Imprint
  • Disclaimer
  • Privacy Policy

© 2021 SEGGER - All rights reserved.