Skip to main content
  • Products
  • Software evaluation
  • Downloads
  • Free utilities
  • Purchase
  • Silicon Vendors
  • Support
  • About us
  • Blog
  • Forum
  • Search
  • Jobs
  • Newsletter
  • Blog
  • Contact
  • Shop
  • Embedded Studio
  • SEGGER Semihosting

    SEGGER Semihosting

    • Standard for most common debug operations
    • Target-indepentend handling
    • Publicly available source package
    • Improved terminal output with host-based formatting
    Buy now Downloads Documentation
    SEGGER Embedded Studio
    1. 1.Overview
    2. 2.Operations
      1. 2.1.Terminal I/O
      2. 2.2.File handling
      3. 2.3.System information
    3. 3.Host-based formatting
    4. 4.Tools support

    Overview

    Semihosting is a mechanism that enables code running on an Embedded System to communicate with and to use the I/O of the host computer through the debugger. For semihosting the target program halts and the debugger does the desired semihosting operation.

    To unify the handling across tools and target architectures, SEGGER has made a generic, portable implementation publicly available: SEGGER Semihosting.


    Operations

    SEGGER Semihosting supports debug operations mainly for terminal I/O, but additionally includes file and system operations. For a list of supported operations refer to SEGGER Semihosting on the SEGGER Knowledge Base.

    Terminal I/O

    Terminal I/O provides operations for sending debug output to a terminal on the host system and receiving input from that terminal.

    These operations can be called directly or integrated as low-level functions for use with standard library functions such as printf(), puts(), gets(), and getc().

    The terminal I/O functionality of the SEGGER Semihosting standard also supports host-based formatting.

    File handling

    Semihosting file functions can be used to create and open files on the host system, read from and write to files, modify file contents, and retrieve file information.

    These functions can be called directly or integrated as low-level functions for use with standard library file I/O routines.

    System information

    System information functions provide information about the host or target system. For example, timing functions can be used on target systems that do not run an operating system or provide their own system timer.

    These functions can also be used to simulate command-line parameters that are passed to the target application by the debugger.


    Host-based formatting

    Host-based formatting can save several kilobytes of flash memory in debug builds that use printf() output..

    Most tool chains and standard libraries let the embedded target do the work of formatting strings in their printf() implementation. They include extra formatter code to parse the format string and to accordingly convert the parameters to strings.

    Formatting strings on the target can significantly increase code size and RAM usage. To reduce this overhead, tool chains often provide different formatter variants with varying feature sets that can be selected on a per-project basis. Developers therefore need to know which printf() features are required and configure the project accordingly.

    SEGGER Semihosting completely eliminates the overhead of formatters while providing full capabilities by using host-based formatting.

    Host-based formatting shifts the burden of formatting from the target system, where resources are limited, to the host system, where resources are plentiful. The host system supports all formatting specifications (such as width, precision, text alignment, floating point, and so on) simply because it has ample resources to do so.

    To use host-based formatting, the target application retargets printf() to directly call SEGGER_SEMIHOST_Writef() without performing any formatting on the target. The debugger intercepts the semihosting operation, reads and parses the format string, converts the supplied parameters accordingly, and prints the resulting output to the debug terminal.


    Tools support

    SEGGER has adopted the semihosting standard in all SEGGER debug tools to ease the access to target's debug output.

    SEGGER - Embedded Studio Product Icon

    Embedded Studio

    Embedded Studio fully supports the SEGGER Semihosting standard, including terminal I/O, file I/O, system operations, and host-based formatting. It also easily creates programs that use semihosting.

    Using Embedded Studio is one of the easiest ways to create and run programs using semihosting.

    ozone product icon SEGGER (Blue)

    Ozone

    Ozone fully supports semihosting operations that comply with either the ARM or SEGGER semihosting standard.

    Applications can be built with any tool chain, including Arm/Keil, IAR, GCC, or Eclipse-based environments. They simply need to invoke the semihosting functions, either through the tool chain's runtime library or, more conveniently, by calling the SEGGER_SEMIHOST_*() functions provided in the reference pack.

    Ozone automatically detects and handles semihosting requests implemented via software breakpoints, supervisor calls, or the generic SEGGER_SEMIHOST_DebugHalt() function. No configuration is required.

    J-Run SEGGER (Blue) 4

    J-Run

    The automated test tool, J-Run detects the use of semihosting in a target application and supports the terminal I/O semihosting operations.

    • User manual
    • Online documentation
    • Release notes

    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
    ISO 27001
    First-class embedded software tools since 1992
    Designed and made in Germany
    • Imprint
    • Disclaimer
    • Code of Conduct
    • Privacy Policy
    © 2026 SEGGER - All rights reserved.