01 Hello World

Link to Source: samples/01_hello_world

Overview

This is a simple sample that demonstrates the basic structure of a Zephyr application. It prints “Hello World” along with the board name to the console.

This sample is useful for:

  • Testing the build setup

  • Understanding the structure of a Zephyr application

  • Verifying the toolchain installation

Building

This application can be built and executed on native_sim as follows:

host:~$ west build -b native_sim samples/01_hello_world -p
host:~$ west build -t run

To build for a real board (e.g., reel_board@2), use:

host:~$ west build -b reel_board@2 samples/01_hello_world -p
host:~$ west flash

Sample Output

*** Booting Zephyr OS build v4.3.0 ***
Hello World! native_sim/native

Exit native_sim by pressing CTRL+C.