From b9f5a68dac6e080486a4966b03a94349e3c1da42 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Tue, 1 Aug 2017 15:41:05 -0400 Subject: [PATCH] samples: zephyr: use unified application Replace the hello1 and hello2 applications with hello-world. Signed-off-by: Marti Bolivar --- samples/zephyr/Makefile | 12 ++++---- samples/zephyr/README.md | 3 -- samples/zephyr/hello1/Makefile | 4 --- samples/zephyr/hello1/README.rst | 38 ------------------------- samples/zephyr/hello1/frdm_k64f.overlay | 9 ------ samples/zephyr/hello1/prj.conf | 7 ----- samples/zephyr/hello1/sample.yaml | 15 ---------- samples/zephyr/hello1/src/Makefile | 1 - samples/zephyr/hello1/src/main.c | 13 --------- samples/zephyr/hello2/Makefile | 4 --- samples/zephyr/hello2/README.rst | 38 ------------------------- samples/zephyr/hello2/frdm_k64f.overlay | 9 ------ samples/zephyr/hello2/prj.conf | 7 ----- samples/zephyr/hello2/sample.yaml | 15 ---------- samples/zephyr/hello2/src/Makefile | 1 - samples/zephyr/hello2/src/main.c | 13 --------- 16 files changed, 6 insertions(+), 183 deletions(-) delete mode 100644 samples/zephyr/hello1/Makefile delete mode 100644 samples/zephyr/hello1/README.rst delete mode 100644 samples/zephyr/hello1/frdm_k64f.overlay delete mode 100644 samples/zephyr/hello1/prj.conf delete mode 100644 samples/zephyr/hello1/sample.yaml delete mode 100644 samples/zephyr/hello1/src/Makefile delete mode 100644 samples/zephyr/hello1/src/main.c delete mode 100644 samples/zephyr/hello2/Makefile delete mode 100644 samples/zephyr/hello2/README.rst delete mode 100644 samples/zephyr/hello2/frdm_k64f.overlay delete mode 100644 samples/zephyr/hello2/prj.conf delete mode 100644 samples/zephyr/hello2/sample.yaml delete mode 100644 samples/zephyr/hello2/src/Makefile delete mode 100644 samples/zephyr/hello2/src/main.c diff --git a/samples/zephyr/Makefile b/samples/zephyr/Makefile index 2b82982d..a2b68b5b 100644 --- a/samples/zephyr/Makefile +++ b/samples/zephyr/Makefile @@ -100,18 +100,18 @@ clean_boot: check # Build and sign "hello1". hello1: check - $(MAKE) -C hello1 BOARD=$(BOARD) -j$(nproc) + $(MAKE) -C hello-world FROM_WHO="hello1" O=outdir/hello1/$(BOARD) BOARD=$(BOARD) -j$(nproc) $(IMGTOOL) sign \ --key $(SIGNING_KEY) \ --header-size $(BOOT_HEADER_LEN) \ --align $(FLASH_ALIGNMENT) \ --version 1.2 \ --included-header \ - hello1/outdir/$(BOARD)/zephyr.bin \ + hello-world/outdir/hello1/$(BOARD)/zephyr.bin \ signed-hello1.bin clean_hello1: check - rm -rf hello1/outdir/$(BOARD) + rm -rf hello-world/outdir/hello1/$(BOARD) # Build and sign "hello2". # This is the same signing command as above, except that it adds the @@ -119,7 +119,7 @@ clean_hello1: check # this image is intended to be an upgrade. It should be flashed into # slot1 instead of slot0. hello2: check - $(MAKE) -C hello2 BOARD=$(BOARD) -j$(nproc) + $(MAKE) -C hello-world FROM_WHO="hello2" O=outdir/hello2/$(BOARD) BOARD=$(BOARD) -j$(nproc) $(IMGTOOL) sign \ --key $(SIGNING_KEY) \ --header-size $(BOOT_HEADER_LEN) \ @@ -127,11 +127,11 @@ hello2: check --version 1.2 \ --included-header \ --pad 0x60000 \ - hello2/outdir/$(BOARD)/zephyr.bin \ + hello-world/outdir/hello2/$(BOARD)/zephyr.bin \ signed-hello2.bin clean_hello2: check - rm -rf hello2/outdir/$(BOARD) + rm -rf hello-world/outdir/hello2/$(BOARD) flash_boot: $(PYOCD_FLASHTOOL) -ce -a 0 mcuboot.bin diff --git a/samples/zephyr/README.md b/samples/zephyr/README.md index 1aaa8c13..cd992474 100644 --- a/samples/zephyr/README.md +++ b/samples/zephyr/README.md @@ -8,6 +8,3 @@ useful. Please see the comments in the Makefile in this directory for more details on how to build and test this application. - -The hello applications were taken directly from the Zephyr source -tree. diff --git a/samples/zephyr/hello1/Makefile b/samples/zephyr/hello1/Makefile deleted file mode 100644 index e70a750a..00000000 --- a/samples/zephyr/hello1/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BOARD ?= qemu_x86 -CONF_FILE = prj.conf - -include ${ZEPHYR_BASE}/Makefile.test diff --git a/samples/zephyr/hello1/README.rst b/samples/zephyr/hello1/README.rst deleted file mode 100644 index 52a25d7a..00000000 --- a/samples/zephyr/hello1/README.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. _hello_world: - -Hello World -########### - -Overview -******** -A simple Hello World example that can be used with any supported board and -prints 'Hello World' to the console. This application can be built into modes: - -* single thread -* multi threading - -Building and Running -******************** - -This project outputs 'Hello World' to the console. It can be built and executed -on QEMU as follows: - -.. code-block:: console - - $ cd samples/hello_world - $ make run - - -To build the single thread version, use the supplied configuration file for -single thread: :file:`prj_single.conf`: - -.. code-block:: console - - $ make CONF_FILE=prj_single.conf run - -Sample Output -============= - -.. code-block:: console - - Hello World! x86 diff --git a/samples/zephyr/hello1/frdm_k64f.overlay b/samples/zephyr/hello1/frdm_k64f.overlay deleted file mode 100644 index 8ca56d73..00000000 --- a/samples/zephyr/hello1/frdm_k64f.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* DTS overlay file. - * vim: ft=dts - */ - -/ { - chosen { - zephyr,code-partition = &slot0_partition; - }; -}; diff --git a/samples/zephyr/hello1/prj.conf b/samples/zephyr/hello1/prj.conf deleted file mode 100644 index b5d941b6..00000000 --- a/samples/zephyr/hello1/prj.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Enable the console -CONFIG_CONSOLE_SHELL=y -CONFIG_KERNEL_SHELL=y - -# Use the bootloader. -CONFIG_BOOT_HEADER=y -CONFIG_TEXT_SECTION_OFFSET=0x200 diff --git a/samples/zephyr/hello1/sample.yaml b/samples/zephyr/hello1/sample.yaml deleted file mode 100644 index 47396bf2..00000000 --- a/samples/zephyr/hello1/sample.yaml +++ /dev/null @@ -1,15 +0,0 @@ -sample: - name: hello world - description: Hello World sample, the simplest Zephyr application - platforms: all -tests: - - test: - build_only: true - tags: samples tests - min_ram: 16 - - singlethread: - build_only: true - extra_args: CONF_FILE=prj_single.conf - filter: not CONFIG_BLUETOOTH and not CONFIG_GPIO_SCH - tags: samples tests - min_ram: 16 diff --git a/samples/zephyr/hello1/src/Makefile b/samples/zephyr/hello1/src/Makefile deleted file mode 100644 index 00066e15..00000000 --- a/samples/zephyr/hello1/src/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y = main.o diff --git a/samples/zephyr/hello1/src/main.c b/samples/zephyr/hello1/src/main.c deleted file mode 100644 index 3acc91dc..00000000 --- a/samples/zephyr/hello1/src/main.c +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2012-2014 Wind River Systems, Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -void main(void) -{ - printk("Hello World number 1! %s\n", CONFIG_ARCH); -} diff --git a/samples/zephyr/hello2/Makefile b/samples/zephyr/hello2/Makefile deleted file mode 100644 index e70a750a..00000000 --- a/samples/zephyr/hello2/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -BOARD ?= qemu_x86 -CONF_FILE = prj.conf - -include ${ZEPHYR_BASE}/Makefile.test diff --git a/samples/zephyr/hello2/README.rst b/samples/zephyr/hello2/README.rst deleted file mode 100644 index 52a25d7a..00000000 --- a/samples/zephyr/hello2/README.rst +++ /dev/null @@ -1,38 +0,0 @@ -.. _hello_world: - -Hello World -########### - -Overview -******** -A simple Hello World example that can be used with any supported board and -prints 'Hello World' to the console. This application can be built into modes: - -* single thread -* multi threading - -Building and Running -******************** - -This project outputs 'Hello World' to the console. It can be built and executed -on QEMU as follows: - -.. code-block:: console - - $ cd samples/hello_world - $ make run - - -To build the single thread version, use the supplied configuration file for -single thread: :file:`prj_single.conf`: - -.. code-block:: console - - $ make CONF_FILE=prj_single.conf run - -Sample Output -============= - -.. code-block:: console - - Hello World! x86 diff --git a/samples/zephyr/hello2/frdm_k64f.overlay b/samples/zephyr/hello2/frdm_k64f.overlay deleted file mode 100644 index 8ca56d73..00000000 --- a/samples/zephyr/hello2/frdm_k64f.overlay +++ /dev/null @@ -1,9 +0,0 @@ -/* DTS overlay file. - * vim: ft=dts - */ - -/ { - chosen { - zephyr,code-partition = &slot0_partition; - }; -}; diff --git a/samples/zephyr/hello2/prj.conf b/samples/zephyr/hello2/prj.conf deleted file mode 100644 index b5d941b6..00000000 --- a/samples/zephyr/hello2/prj.conf +++ /dev/null @@ -1,7 +0,0 @@ -# Enable the console -CONFIG_CONSOLE_SHELL=y -CONFIG_KERNEL_SHELL=y - -# Use the bootloader. -CONFIG_BOOT_HEADER=y -CONFIG_TEXT_SECTION_OFFSET=0x200 diff --git a/samples/zephyr/hello2/sample.yaml b/samples/zephyr/hello2/sample.yaml deleted file mode 100644 index 47396bf2..00000000 --- a/samples/zephyr/hello2/sample.yaml +++ /dev/null @@ -1,15 +0,0 @@ -sample: - name: hello world - description: Hello World sample, the simplest Zephyr application - platforms: all -tests: - - test: - build_only: true - tags: samples tests - min_ram: 16 - - singlethread: - build_only: true - extra_args: CONF_FILE=prj_single.conf - filter: not CONFIG_BLUETOOTH and not CONFIG_GPIO_SCH - tags: samples tests - min_ram: 16 diff --git a/samples/zephyr/hello2/src/Makefile b/samples/zephyr/hello2/src/Makefile deleted file mode 100644 index 00066e15..00000000 --- a/samples/zephyr/hello2/src/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-y = main.o diff --git a/samples/zephyr/hello2/src/main.c b/samples/zephyr/hello2/src/main.c deleted file mode 100644 index 784f206d..00000000 --- a/samples/zephyr/hello2/src/main.c +++ /dev/null @@ -1,13 +0,0 @@ -/* - * Copyright (c) 2012-2014 Wind River Systems, Inc. - * - * SPDX-License-Identifier: Apache-2.0 - */ - -#include -#include - -void main(void) -{ - printk("Upgraded hello! %s\n", CONFIG_ARCH); -}