From 86eea62e0bca2f4743be2dc55bf18e653e0b80da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Mon, 17 Feb 2025 08:23:42 +0100 Subject: [PATCH] samples: sensor: Use dedicated overlay for fake sensor in sensor_shell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using an app.overlay file is inherently preventing the use of board overlays. Switch to a dedicated overlay file so that e.g. the vmu_rt1170/mimxrt1176/cm7 board target can pass this test where before it would have failed due to its board-specific overlay "winning" over the app.overlay file. Signed-off-by: Benjamin Cabé --- samples/sensor/sensor_shell/Kconfig | 2 ++ samples/sensor/sensor_shell/README.rst | 5 +++-- .../sensor/sensor_shell/{app.overlay => fake_sensor.overlay} | 0 samples/sensor/sensor_shell/sample.yaml | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) rename samples/sensor/sensor_shell/{app.overlay => fake_sensor.overlay} (100%) diff --git a/samples/sensor/sensor_shell/Kconfig b/samples/sensor/sensor_shell/Kconfig index 38fcdfa7eb6e..8d274a19032d 100644 --- a/samples/sensor/sensor_shell/Kconfig +++ b/samples/sensor/sensor_shell/Kconfig @@ -3,6 +3,8 @@ config SAMPLES_SENSOR_SHELL_FAKE_SENSOR bool "Enable fake sensor" + default y + depends on DT_HAS_VND_FAKE_SENSOR_ENABLED help On boards that do not have a sensor, enabling this will build a fake sensor that can be interacted with via the sensor shell. diff --git a/samples/sensor/sensor_shell/README.rst b/samples/sensor/sensor_shell/README.rst index 9853157d89ff..65653741bc21 100644 --- a/samples/sensor/sensor_shell/README.rst +++ b/samples/sensor/sensor_shell/README.rst @@ -19,13 +19,14 @@ enabled, for example: :board: reel_board :goals: build flash -For boards that do not have a sensor, a simple fake sensor driver is provided, for example: +For boards that do not have a sensor, a simple fake sensor driver is provided and can enabled by +adding the following overlay: .. zephyr-app-commands:: :zephyr-app: samples/sensor/sensor_shell :board: qemu_riscv64 :goals: run - :gen-args: -DCONFIG_SAMPLES_SENSOR_SHELL_FAKE_SENSOR=y + :gen-args: -DEXTRA_DTC_OVERLAY_FILE=fake_sensor.overlay Shell Module Command Help ========================= diff --git a/samples/sensor/sensor_shell/app.overlay b/samples/sensor/sensor_shell/fake_sensor.overlay similarity index 100% rename from samples/sensor/sensor_shell/app.overlay rename to samples/sensor/sensor_shell/fake_sensor.overlay diff --git a/samples/sensor/sensor_shell/sample.yaml b/samples/sensor/sensor_shell/sample.yaml index a694f1405892..15b9defabbc5 100644 --- a/samples/sensor/sensor_shell/sample.yaml +++ b/samples/sensor/sensor_shell/sample.yaml @@ -22,6 +22,6 @@ tests: timeout: 180 extra_configs: - arch:posix:CONFIG_NATIVE_UART_0_ON_STDINOUT=y - - CONFIG_SAMPLES_SENSOR_SHELL_FAKE_SENSOR=y + extra_args: DTC_OVERLAY_FILE=fake_sensor.overlay integration_platforms: - native_sim