diff --git a/CODEOWNERS b/CODEOWNERS index fbbdd4df95..a5bb38dc9a 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -163,7 +163,7 @@ /modules/coremark/ @nrfconnect/ncs-si-bluebagel # Samples -/samples/ @nrfconnect/ncs-code-owners +#/samples/ @nrfconnect/ncs-code-owners /samples/CMakeLists.txt @nrfconnect/ncs-co-build-system /samples/net/ @nrfconnect/ncs-cia @nrfconnect/ncs-modem /samples/sensor/bh1749/ @nrfconnect/ncs-cia diff --git a/samples/hello/CMakeLists.txt b/samples/hello/CMakeLists.txt new file mode 100644 index 0000000000..ecb7d24bb8 --- /dev/null +++ b/samples/hello/CMakeLists.txt @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: Apache-2.0 + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(hello_world) + +target_sources(app PRIVATE src/main.c) diff --git a/samples/hello/README.rst b/samples/hello/README.rst new file mode 100644 index 0000000000..25b346e90f --- /dev/null +++ b/samples/hello/README.rst @@ -0,0 +1,36 @@ +.. zephyr:code-sample:: hello_world + :name: Hello World + + Print "Hello World" to the console. + +Hello World +########### + +Overview +******** + +A simple sample that can be used with any :ref:`supported board ` and +prints "Hello World" to the console. + +Building and Running +******************** + +This application can be built and executed on QEMU as follows: + +.. zephyr-app-commands:: + :zephyr-app: samples/hello_world + :host-os: unix + :board: qemu_x86 + :goals: run + :compact: + +To build for another board, change "qemu_x86" above to that board's name. + +Sample Output +============= + +.. code-block:: console + + Hello World! x86 + +Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`. diff --git a/samples/hello/prj.conf b/samples/hello/prj.conf new file mode 100644 index 0000000000..b2a4ba5910 --- /dev/null +++ b/samples/hello/prj.conf @@ -0,0 +1 @@ +# nothing here diff --git a/samples/hello/sample.yaml b/samples/hello/sample.yaml new file mode 100644 index 0000000000..1bcb7db62f --- /dev/null +++ b/samples/hello/sample.yaml @@ -0,0 +1,16 @@ +sample: + description: Hello World sample, the simplest Zephyr + application + name: hello world +common: + tags: introduction + integration_platforms: + - native_sim + harness: console + harness_config: + type: one_line + regex: + - "Hello World! (.*)" +tests: + sample.basic.helloworld: + tags: introduction diff --git a/samples/hello/src/main.c b/samples/hello/src/main.c new file mode 100644 index 0000000000..c550ab461c --- /dev/null +++ b/samples/hello/src/main.c @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2012-2014 Wind River Systems, Inc. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include + +int main(void) +{ + printf("Hello World! %s\n", CONFIG_BOARD_TARGET); + + return 0; +}