From a06ec42f493ad1d5fa801606abeea89922786d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Thu, 27 Feb 2025 11:12:16 +0100 Subject: [PATCH 1/5] samples: basic: blinky: Extend upstream sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add sample that reuses source code from "original" sample that existing in the upstream Zephyr. Extend sample with configuration that uses emulated GPIO instead of "ordinary" GPIO. Remove Twister alt-config for upstream sample. Signed-off-by: Sebastian Głąb --- CODEOWNERS | 2 +- samples/basic/blinky/CMakeLists.txt | 11 +++++++++++ samples/basic/blinky/README.txt | 3 +++ .../boards/nrf54l15dk_nrf54l15_cpuapp_egpio.overlay | 9 +++++++++ samples/basic/blinky/prj.conf | 1 + .../samples => samples}/basic/blinky/sample.yaml | 12 ++++-------- scripts/ci/tags.yaml | 2 ++ 7 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 samples/basic/blinky/CMakeLists.txt create mode 100644 samples/basic/blinky/README.txt create mode 100644 samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_egpio.overlay create mode 100644 samples/basic/blinky/prj.conf rename {scripts/twister/alt/zephyr/samples => samples}/basic/blinky/sample.yaml (86%) diff --git a/CODEOWNERS b/CODEOWNERS index df99fb3f635e..9a6852ac08a9 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -439,6 +439,7 @@ /samples/CMakeLists.txt @nrfconnect/ncs-co-build-system /samples/app_event_manager/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel /samples/app_event_manager_profiler_tracer/ @nrfconnect/ncs-si-muffin @nrfconnect/ncs-si-bluebagel +/samples/basic/blinky/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus /samples/benchmarks/coremark/ @nrfconnect/ncs-si-bluebagel /samples/bluetooth/nrf_auraconfig/ @nrfconnect/ncs-audio /samples/bluetooth/central_and_peripheral_hr/ @nrfconnect/ncs-si-muffin @@ -704,7 +705,6 @@ /scripts/partition_manager/*.rst @nrfconnect/ncs-aurora-doc /scripts/shell/ble_console/**/*.rst @nrfconnect/ncs-doc-leads /scripts/west_commands/sbom/*.rst @nrfconnect/ncs-si-muffin-doc -/scripts/twister/alt/zephyr/samples/basic/ @nrfconnect/ncs-ll-ursus /scripts/twister/alt/zephyr/samples/sensor/ @nrfconnect/ncs-low-level-test /scripts/twister/alt/zephyr/tests/drivers/ @nrfconnect/ncs-low-level-test diff --git a/samples/basic/blinky/CMakeLists.txt b/samples/basic/blinky/CMakeLists.txt new file mode 100644 index 000000000000..faa8e6d981c4 --- /dev/null +++ b/samples/basic/blinky/CMakeLists.txt @@ -0,0 +1,11 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(blinky) + +target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/basic/blinky/src/main.c) diff --git a/samples/basic/blinky/README.txt b/samples/basic/blinky/README.txt new file mode 100644 index 000000000000..7165d27c7be7 --- /dev/null +++ b/samples/basic/blinky/README.txt @@ -0,0 +1,3 @@ +This sample extends the same-named Zephyr sample to verify it with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/samples/basic/blinky. diff --git a/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_egpio.overlay b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_egpio.overlay new file mode 100644 index 000000000000..a7f4e8730bed --- /dev/null +++ b/samples/basic/blinky/boards/nrf54l15dk_nrf54l15_cpuapp_egpio.overlay @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2025 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +&led0 { + gpios = <&egpio 9 GPIO_ACTIVE_HIGH>; +}; diff --git a/samples/basic/blinky/prj.conf b/samples/basic/blinky/prj.conf new file mode 100644 index 000000000000..91c3c15b37d1 --- /dev/null +++ b/samples/basic/blinky/prj.conf @@ -0,0 +1 @@ +CONFIG_GPIO=y diff --git a/scripts/twister/alt/zephyr/samples/basic/blinky/sample.yaml b/samples/basic/blinky/sample.yaml similarity index 86% rename from scripts/twister/alt/zephyr/samples/basic/blinky/sample.yaml rename to samples/basic/blinky/sample.yaml index 7f310bc7ec81..18d1f4777a5c 100644 --- a/scripts/twister/alt/zephyr/samples/basic/blinky/sample.yaml +++ b/samples/basic/blinky/sample.yaml @@ -4,15 +4,11 @@ common: tags: - LED - gpio + - ci_tests_drivers_sdp depends_on: gpio tests: - sample.basic.blinky: - filter: dt_enabled_alias_with_parent_compat("led0", "gpio-leds") - harness: led - integration_platforms: - - frdm_k64f - sample.basic.blinky.sdp.gpio.icmsg: + nrf.extended.sample.basic.blinky.sdp.gpio.icmsg: sysbuild: true platform_allow: - nrf54l15dk/nrf54l15/cpuapp @@ -32,7 +28,7 @@ tests: - "LED state: ON" - "LED state: OFF" - sample.basic.blinky.sdp.gpio.mbox: + nrf.extended.sample.basic.blinky.sdp.gpio.mbox: sysbuild: true platform_allow: - nrf54l15dk/nrf54l15/cpuapp @@ -52,7 +48,7 @@ tests: - "LED state: ON" - "LED state: OFF" - sample.basic.blinky.sdp.gpio.icbmsg: + nrf.extended.sample.basic.blinky.sdp.gpio.icbmsg: sysbuild: true platform_allow: - nrf54l15dk/nrf54l15/cpuapp diff --git a/scripts/ci/tags.yaml b/scripts/ci/tags.yaml index 4952cbf6d940..b54ec7408546 100644 --- a/scripts/ci/tags.yaml +++ b/scripts/ci/tags.yaml @@ -1314,6 +1314,8 @@ ci_tests_drivers_sdp: - nrf/tests/drivers/sdp_asm/ - zephyr/drivers/mbox/ - zephyr/subsys/ipc/ipc_service/ + - nrf/samples/basic/blinky/ + - zephyr/samples/basic/blinky/ ci_tests_drivers_gpio: files: From 6c0aecd5d7f800d4650de1d53ba3aa646d039f60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Thu, 27 Feb 2025 11:44:13 +0100 Subject: [PATCH 2/5] samples: sensor: accel_polling: Extend upstream sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add sample that reuses source code from "original" sample that existing in the upstream Zephyr. Extend sample with configurations that rely on internal shields pca63565 and pca63566. Remove Twister alt-config for upstream sample. Signed-off-by: Sebastian Głąb --- CODEOWNERS | 1 + samples/sensor/accel_polling/CMakeLists.txt | 11 +++++++++++ samples/sensor/accel_polling/README.txt | 3 +++ samples/sensor/accel_polling/prj.conf | 3 +++ .../sensor/accel_polling/sample.yaml | 15 ++++++++------- scripts/ci/tags.yaml | 5 +++++ 6 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 samples/sensor/accel_polling/CMakeLists.txt create mode 100644 samples/sensor/accel_polling/README.txt create mode 100644 samples/sensor/accel_polling/prj.conf rename {scripts/twister/alt/zephyr/samples => samples}/sensor/accel_polling/sample.yaml (82%) diff --git a/CODEOWNERS b/CODEOWNERS index 9a6852ac08a9..f760909c66cc 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -529,6 +529,7 @@ /samples/nfc/ @nrfconnect/ncs-si-muffin /samples/nrf5340/netboot/ @nrfconnect/ncs-pluto /samples/nrf_rpc/ @nrfconnect/ncs-si-muffin +/samples/sensor/accel_polling/ @nrfconnect/ncs-low-level-test /samples/sensor/bh1749/ @nrfconnect/ncs-cia /samples/sensor/bme68x_iaq/ @nrfconnect/ncs-cia /samples/sensor/qdec/ @nrfconnect/ncs-low-level-test diff --git a/samples/sensor/accel_polling/CMakeLists.txt b/samples/sensor/accel_polling/CMakeLists.txt new file mode 100644 index 000000000000..328256caceb0 --- /dev/null +++ b/samples/sensor/accel_polling/CMakeLists.txt @@ -0,0 +1,11 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(accel_polling) + +target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/sensor/accel_polling/src/main.c) diff --git a/samples/sensor/accel_polling/README.txt b/samples/sensor/accel_polling/README.txt new file mode 100644 index 000000000000..561ba50f535d --- /dev/null +++ b/samples/sensor/accel_polling/README.txt @@ -0,0 +1,3 @@ +This sample extends the same-named Zephyr sample to verify it with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/samples/sensor/accel_polling. diff --git a/samples/sensor/accel_polling/prj.conf b/samples/sensor/accel_polling/prj.conf new file mode 100644 index 000000000000..fb14ccba74f6 --- /dev/null +++ b/samples/sensor/accel_polling/prj.conf @@ -0,0 +1,3 @@ +CONFIG_STDOUT_CONSOLE=y +CONFIG_SENSOR=y +CONFIG_CBPRINTF_FP_SUPPORT=y diff --git a/scripts/twister/alt/zephyr/samples/sensor/accel_polling/sample.yaml b/samples/sensor/accel_polling/sample.yaml similarity index 82% rename from scripts/twister/alt/zephyr/samples/sensor/accel_polling/sample.yaml rename to samples/sensor/accel_polling/sample.yaml index 7a639297377b..ebd13e5b66b2 100644 --- a/scripts/twister/alt/zephyr/samples/sensor/accel_polling/sample.yaml +++ b/samples/sensor/accel_polling/sample.yaml @@ -6,10 +6,11 @@ common: - drivers - spi - sensors + - ci_samples_sensor_accel_polling harness: console tests: - sample.sensor.accel_polling.nrf54h: + nrf.extended.sample.sensor.accel_polling.nrf54h: filter: not CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -24,7 +25,7 @@ tests: - CONFIG_SENSOR_LOG_LEVEL_DBG=y platform_allow: nrf54h20dk/nrf54h20/cpuapp - sample.sensor.accel_polling.nrf54h_cpuppr: + nrf.extended.sample.sensor.accel_polling.nrf54h_cpuppr: filter: not CONFIG_COVERAGE sysbuild: true harness_config: @@ -38,7 +39,7 @@ tests: - vpr_launcher_SHIELD=pca63566_fwd platform_allow: nrf54h20dk/nrf54h20/cpuppr - sample.sensor.accel_polling.nrf54h_coverage: + nrf.extended.sample.sensor.accel_polling.nrf54h_coverage: filter: CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -50,7 +51,7 @@ tests: - SHIELD=pca63566;coverage_support platform_allow: nrf54h20dk/nrf54h20/cpuapp - sample.sensor.accel_polling.nrf54l: + nrf.extended.sample.sensor.accel_polling.nrf54l: filter: not CONFIG_COVERAGE harness_config: fixture: pca63565 @@ -65,7 +66,7 @@ tests: - CONFIG_SENSOR_LOG_LEVEL_DBG=y platform_allow: nrf54l15dk/nrf54l15/cpuapp - sample.sensor.accel_polling.nrf54l_coverage: + nrf.extended.sample.sensor.accel_polling.nrf54l_coverage: filter: CONFIG_COVERAGE harness_config: fixture: pca63565 @@ -77,7 +78,7 @@ tests: - SHIELD=pca63565;coverage_support platform_allow: nrf54l15dk/nrf54l15/cpuapp - sample.sensor.accel_polling.nrf54l15_cpuflpr: + nrf.extended.sample.sensor.accel_polling.nrf54l15_cpuflpr: filter: not CONFIG_COVERAGE sysbuild: true harness_config: @@ -88,7 +89,7 @@ tests: s*-?[0-9\\.]*,\\s*-?[0-9\\.]*\\)$" extra_args: - SHIELD=pca63565 - - vpr_launcher_DTC_OVERLAY_FILE="../../../../nrf/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" + - vpr_launcher_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" extra_configs: - CONFIG_LOG=y - CONFIG_SENSOR_LOG_LEVEL_DBG=y diff --git a/scripts/ci/tags.yaml b/scripts/ci/tags.yaml index b54ec7408546..29b4c8698ee7 100644 --- a/scripts/ci/tags.yaml +++ b/scripts/ci/tags.yaml @@ -1518,6 +1518,11 @@ ci_samples_nrf5340: - zephyr/subsys/shell/ - zephyr/subsys/usb/ +ci_samples_sensor_accel_polling: + files: + - nrf/samples/sensor/accel_polling/ + - zephyr/samples/sensor/accel_polling/ + ci_samples_sensor_qdec: files: - nrf/samples/sensor/qdec/ From 1bd7d368ce02121467ad223e8b5da9a32e8b6a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Thu, 27 Feb 2025 14:01:22 +0100 Subject: [PATCH 3/5] tests: drivers: i2c: i2c_bme688: Extend upstream sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add test that reuses source code from "original" test that existing in the upstream Zephyr. Extend sample with configurations that rely on internal shields pca63565 and pca63566. Remove Twister alt-config for upstream test. Signed-off-by: Sebastian Głąb --- CODEOWNERS | 1 + scripts/ci/tags.yaml | 5 ++++ tests/drivers/i2c/i2c_bme688/CMakeLists.txt | 13 ++++++++++ tests/drivers/i2c/i2c_bme688/Kconfig | 7 ++++++ tests/drivers/i2c/i2c_bme688/README.txt | 3 +++ tests/drivers/i2c/i2c_bme688/prj.conf | 2 ++ .../drivers/i2c/i2c_bme688/testcase.yaml | 25 ++++++++++--------- 7 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 tests/drivers/i2c/i2c_bme688/CMakeLists.txt create mode 100644 tests/drivers/i2c/i2c_bme688/Kconfig create mode 100644 tests/drivers/i2c/i2c_bme688/README.txt create mode 100644 tests/drivers/i2c/i2c_bme688/prj.conf rename {scripts/twister/alt/zephyr/tests => tests}/drivers/i2c/i2c_bme688/testcase.yaml (74%) diff --git a/CODEOWNERS b/CODEOWNERS index f760909c66cc..356cdf5b9a58 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -836,6 +836,7 @@ /tests/drivers/flash/flash_rpc/ @nrfconnect/ncs-pluto /tests/drivers/flash_patch/ @nrfconnect/ncs-pluto /tests/drivers/fprotect/ @nrfconnect/ncs-pluto +/tests/drivers/i2c/i2c_bme688/ @nrfconnect/ncs-low-level-test /tests/drivers/lpuart/ @nordic-krch /tests/drivers/nrfx_integration_test/ @nrfconnect/ncs-co-drivers /tests/drivers/i2c/i2c_target_api/ @nrfconnect/ncs-low-level-test diff --git a/scripts/ci/tags.yaml b/scripts/ci/tags.yaml index 29b4c8698ee7..b099a0d3de25 100644 --- a/scripts/ci/tags.yaml +++ b/scripts/ci/tags.yaml @@ -1538,6 +1538,11 @@ ci_samples_drivers_audio_dmic: - nrf/samples/drivers/audio/dmic/ - zephyr/samples/drivers/audio/dmic/ +ci_tests_drivers_i2c_i2c_bme688: + files: + - nrf/tests/drivers/i2c/i2c_bme688 + - zephyr/tests/drivers/i2c/i2c_bme688 + ci_tests_drivers_spi: files: - nrf/tests/drivers/spi/ diff --git a/tests/drivers/i2c/i2c_bme688/CMakeLists.txt b/tests/drivers/i2c/i2c_bme688/CMakeLists.txt new file mode 100644 index 000000000000..57df1b50b17a --- /dev/null +++ b/tests/drivers/i2c/i2c_bme688/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(i2c_bme688) + +FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/drivers/i2c/i2c_bme688/src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/i2c/i2c_bme688/Kconfig b/tests/drivers/i2c/i2c_bme688/Kconfig new file mode 100644 index 000000000000..9626ce498243 --- /dev/null +++ b/tests/drivers/i2c/i2c_bme688/Kconfig @@ -0,0 +1,7 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +source "tests/drivers/i2c/i2c_bme688/Kconfig" diff --git a/tests/drivers/i2c/i2c_bme688/README.txt b/tests/drivers/i2c/i2c_bme688/README.txt new file mode 100644 index 000000000000..d75c627ba9b8 --- /dev/null +++ b/tests/drivers/i2c/i2c_bme688/README.txt @@ -0,0 +1,3 @@ +This sample extends the same-named Zephyr sample to verify it with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/drivers/i2c/i2c_bme688. diff --git a/tests/drivers/i2c/i2c_bme688/prj.conf b/tests/drivers/i2c/i2c_bme688/prj.conf new file mode 100644 index 000000000000..4b19609ecfbd --- /dev/null +++ b/tests/drivers/i2c/i2c_bme688/prj.conf @@ -0,0 +1,2 @@ +CONFIG_I2C=y +CONFIG_ZTEST=y diff --git a/scripts/twister/alt/zephyr/tests/drivers/i2c/i2c_bme688/testcase.yaml b/tests/drivers/i2c/i2c_bme688/testcase.yaml similarity index 74% rename from scripts/twister/alt/zephyr/tests/drivers/i2c/i2c_bme688/testcase.yaml rename to tests/drivers/i2c/i2c_bme688/testcase.yaml index dc4e3f21f8a7..46b0a8ea8265 100644 --- a/scripts/twister/alt/zephyr/tests/drivers/i2c/i2c_bme688/testcase.yaml +++ b/tests/drivers/i2c/i2c_bme688/testcase.yaml @@ -2,35 +2,36 @@ common: tags: - drivers - i2c + - ci_tests_drivers_i2c_i2c_bme688 depends_on: i2c harness: ztest tests: - drivers.i2c.bme688_nrf54l: + nrf.extended.drivers.i2c.bme688_nrf54l: filter: not CONFIG_COVERAGE harness_config: fixture: pca63565 extra_args: - SHIELD=pca63565 - SB_CONFIG_VPR_LAUNCHER=y - - vpr_launcher_DTC_OVERLAY_FILE="../../../../nrf/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" + - vpr_launcher_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - drivers.i2c.bme688_nrf54l_fast_speed: + nrf.extended.drivers.i2c.bme688_nrf54l_fast_speed: filter: not CONFIG_COVERAGE harness_config: fixture: pca63565 extra_args: - SHIELD=pca63565 - SB_CONFIG_VPR_LAUNCHER=y - - vpr_launcher_DTC_OVERLAY_FILE="../../../../nrf/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" + - vpr_launcher_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" - CONFIG_TEST_I2C_SPEED=2 platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - drivers.i2c.bme688_nrf54l_coverage: + nrf.extended.drivers.i2c.bme688_nrf54l_coverage: filter: CONFIG_COVERAGE harness_config: fixture: pca63565 @@ -39,7 +40,7 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - drivers.i2c.bme688_nrf54l_coverage_fast_speed: + nrf.extended.drivers.i2c.bme688_nrf54l_coverage_fast_speed: filter: CONFIG_COVERAGE harness_config: fixture: pca63565 @@ -49,7 +50,7 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - drivers.i2c.bme688_nrf54h: + nrf.extended.drivers.i2c.bme688_nrf54h: filter: not CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -61,7 +62,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - drivers.i2c.bme688_nrf54h_fast_speed: + nrf.extended.drivers.i2c.bme688_nrf54h_fast_speed: filter: not CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -74,7 +75,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - drivers.i2c.bme688_nrf54h_fast_plus_speed: + nrf.extended.drivers.i2c.bme688_nrf54h_fast_plus_speed: filter: not CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -87,7 +88,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - drivers.i2c.bme688_nrf54h_coverage: + nrf.extended.drivers.i2c.bme688_nrf54h_coverage: filter: CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -96,7 +97,7 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - drivers.i2c.bme688_nrf54h_coverage_fast_speed: + nrf.extended.drivers.i2c.bme688_nrf54h_coverage_fast_speed: filter: CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -106,7 +107,7 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - drivers.i2c.bme688_nrf54h_coverage_fast_plus_speed: + nrf.extended.drivers.i2c.bme688_nrf54h_coverage_fast_plus_speed: filter: CONFIG_COVERAGE harness_config: fixture: pca63566 From 6eaf41b6fbf5e8171b14a3e178723fd13d57781f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Thu, 27 Feb 2025 16:09:00 +0100 Subject: [PATCH 4/5] samples: Fix absolute path in target_sources() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use target_sources(app PRIVATE ${ZEPHYR_BASE}/[path to sources]) instead of target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/[path to sources]) Signed-off-by: Sebastian Głąb --- samples/drivers/audio/dmic/CMakeLists.txt | 2 +- samples/sensor/qdec/CMakeLists.txt | 2 +- samples/subsys/settings/CMakeLists.txt | 2 +- .../benchmarks/current_consumption/system_off/CMakeLists.txt | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/drivers/audio/dmic/CMakeLists.txt b/samples/drivers/audio/dmic/CMakeLists.txt index 62df82e6f902..a022b0c36918 100644 --- a/samples/drivers/audio/dmic/CMakeLists.txt +++ b/samples/drivers/audio/dmic/CMakeLists.txt @@ -8,4 +8,4 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(dmic) -target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/samples/drivers/audio/dmic/src/main.c) +target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/drivers/audio/dmic/src/main.c) diff --git a/samples/sensor/qdec/CMakeLists.txt b/samples/sensor/qdec/CMakeLists.txt index f7b00c8b766e..9fb6aace327b 100644 --- a/samples/sensor/qdec/CMakeLists.txt +++ b/samples/sensor/qdec/CMakeLists.txt @@ -8,4 +8,4 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(qdec_sensor) -target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/samples/sensor/qdec/src/main.c) +target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/sensor/qdec/src/main.c) diff --git a/samples/subsys/settings/CMakeLists.txt b/samples/subsys/settings/CMakeLists.txt index 6f0ca2ed766b..32b6271e57b1 100644 --- a/samples/subsys/settings/CMakeLists.txt +++ b/samples/subsys/settings/CMakeLists.txt @@ -8,4 +8,4 @@ cmake_minimum_required(VERSION 3.20.0) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(settings_sample) -target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/samples/subsys/settings/src/main.c) +target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/subsys/settings/src/main.c) diff --git a/tests/benchmarks/current_consumption/system_off/CMakeLists.txt b/tests/benchmarks/current_consumption/system_off/CMakeLists.txt index 80b8e20cc744..3f85d01427f0 100644 --- a/tests/benchmarks/current_consumption/system_off/CMakeLists.txt +++ b/tests/benchmarks/current_consumption/system_off/CMakeLists.txt @@ -9,7 +9,7 @@ set(KCONFIG_ROOT $ENV{ZEPHYR_BASE}/samples/boards/nordic/system_off/Kconfig) find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) project(system_off) -target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/samples/boards/nordic/system_off/src/main.c) +target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/boards/nordic/system_off/src/main.c) if(CONFIG_APP_USE_NRF_RETENTION OR CONFIG_APP_USE_RETAINED_MEM) - target_sources(app PRIVATE $ENV{ZEPHYR_BASE}/samples/boards/nordic/system_off/src/retained.c) + target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/boards/nordic/system_off/src/retained.c) endif() From 9ea31c55294cc8098611ba303e8c2e7e81dfa1e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Fri, 28 Feb 2025 09:20:04 +0100 Subject: [PATCH 5/5] samples: sensor: bme680: Extend upstream sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add sample that reuses source code from "original" sample that existing in the upstream Zephyr. Extend sample with configurations that rely on internal shields pca63565 and pca63566. Remove Twister alt-config for upstream sample. Signed-off-by: Sebastian Głąb --- CODEOWNERS | 2 +- samples/sensor/bme680/CMakeLists.txt | 12 ++++++ samples/sensor/bme680/README.txt | 3 ++ samples/sensor/bme680/prj.conf | 3 ++ .../sensor/bme680/sample.yaml | 15 ++++--- samples/sensor/bme680/src/main.c | 43 +++++++++++++++++++ scripts/ci/tags.yaml | 5 +++ 7 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 samples/sensor/bme680/CMakeLists.txt create mode 100644 samples/sensor/bme680/README.txt create mode 100644 samples/sensor/bme680/prj.conf rename {scripts/twister/alt/zephyr/samples => samples}/sensor/bme680/sample.yaml (81%) create mode 100644 samples/sensor/bme680/src/main.c diff --git a/CODEOWNERS b/CODEOWNERS index 356cdf5b9a58..57e80fd3dccb 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -531,6 +531,7 @@ /samples/nrf_rpc/ @nrfconnect/ncs-si-muffin /samples/sensor/accel_polling/ @nrfconnect/ncs-low-level-test /samples/sensor/bh1749/ @nrfconnect/ncs-cia +/samples/sensor/bme680/ @nrfconnect/ncs-low-level-test /samples/sensor/bme68x_iaq/ @nrfconnect/ncs-cia /samples/sensor/qdec/ @nrfconnect/ncs-low-level-test /samples/subsys/settings/ @nrfconnect/ncs-low-level-test @@ -706,7 +707,6 @@ /scripts/partition_manager/*.rst @nrfconnect/ncs-aurora-doc /scripts/shell/ble_console/**/*.rst @nrfconnect/ncs-doc-leads /scripts/west_commands/sbom/*.rst @nrfconnect/ncs-si-muffin-doc -/scripts/twister/alt/zephyr/samples/sensor/ @nrfconnect/ncs-low-level-test /scripts/twister/alt/zephyr/tests/drivers/ @nrfconnect/ncs-low-level-test # Share diff --git a/samples/sensor/bme680/CMakeLists.txt b/samples/sensor/bme680/CMakeLists.txt new file mode 100644 index 000000000000..fb360d52169a --- /dev/null +++ b/samples/sensor/bme680/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (c) 2018 Bosch Sensortec GmbH +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(bme680) + +FILE(GLOB app_sources src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/samples/sensor/bme680/README.txt b/samples/sensor/bme680/README.txt new file mode 100644 index 000000000000..03b6a3690695 --- /dev/null +++ b/samples/sensor/bme680/README.txt @@ -0,0 +1,3 @@ +This sample extends the same-named Zephyr sample to verify it with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/samples/sensor/bme680. diff --git a/samples/sensor/bme680/prj.conf b/samples/sensor/bme680/prj.conf new file mode 100644 index 000000000000..d1027c82490f --- /dev/null +++ b/samples/sensor/bme680/prj.conf @@ -0,0 +1,3 @@ +CONFIG_STDOUT_CONSOLE=y +CONFIG_I2C=y +CONFIG_SENSOR=y diff --git a/scripts/twister/alt/zephyr/samples/sensor/bme680/sample.yaml b/samples/sensor/bme680/sample.yaml similarity index 81% rename from scripts/twister/alt/zephyr/samples/sensor/bme680/sample.yaml rename to samples/sensor/bme680/sample.yaml index 4c4b129c43d9..c3ebebfec872 100644 --- a/scripts/twister/alt/zephyr/samples/sensor/bme680/sample.yaml +++ b/samples/sensor/bme680/sample.yaml @@ -6,10 +6,11 @@ common: - drivers - i2c - sensors + - ci_samples_sensor_bme680 harness: console tests: - sample.sensor.bme680.nrf54h: + nrf.extended.sample.sensor.bme680.nrf54h: filter: not CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -21,7 +22,7 @@ tests: - SHIELD=pca63566 platform_allow: nrf54h20dk/nrf54h20/cpuapp - sample.sensor.bme680.nrf54h_cpuppr: + nrf.extended.sample.sensor.bme680.nrf54h_cpuppr: filter: not CONFIG_COVERAGE sysbuild: true harness_config: @@ -35,7 +36,7 @@ tests: - vpr_launcher_SHIELD=pca63566_fwd platform_allow: nrf54h20dk/nrf54h20/cpuppr - sample.sensor.bme680.nrf54h_coverage: + nrf.extended.sample.sensor.bme680.nrf54h_coverage: filter: CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -47,7 +48,7 @@ tests: - SHIELD=pca63566;coverage_support platform_allow: nrf54h20dk/nrf54h20/cpuapp - sample.sensor.bme680.nrf54l: + nrf.extended.sample.sensor.bme680.nrf54l: filter: not CONFIG_COVERAGE harness_config: fixture: pca63565 @@ -59,7 +60,7 @@ tests: - SHIELD=pca63565 platform_allow: nrf54l15dk/nrf54l15/cpuapp - sample.sensor.bme680.nrf54l_coverage: + nrf.extended.sample.sensor.bme680.nrf54l_coverage: filter: CONFIG_COVERAGE harness_config: fixture: pca63565 @@ -71,7 +72,7 @@ tests: - SHIELD=pca63565;coverage_support platform_allow: nrf54l15dk/nrf54l15/cpuapp - sample.sensor.bme680.nrf54l_cpuflpr: + nrf.extended.sample.sensor.bme680.nrf54l_cpuflpr: filter: not CONFIG_COVERAGE sysbuild: true harness_config: @@ -82,5 +83,5 @@ tests: .]*$" extra_args: - SHIELD=pca63565 - - vpr_launcher_DTC_OVERLAY_FILE="../../../../nrf/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" + - vpr_launcher_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" platform_allow: nrf54l15dk/nrf54l15/cpuflpr diff --git a/samples/sensor/bme680/src/main.c b/samples/sensor/bme680/src/main.c new file mode 100644 index 000000000000..8ab830d2f031 --- /dev/null +++ b/samples/sensor/bme680/src/main.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2018 Bosch Sensortec GmbH + * + * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause + */ + +#include +#include +#include +#include + +int main(void) +{ + const struct device *const dev = DEVICE_DT_GET_ONE(bosch_bme680); + struct sensor_value temp, press, humidity, gas_res; + + if (!device_is_ready(dev)) { + printk("sensor: device not ready.\n"); + return 0; + } + + printf("Device %p name is %s\n", dev, dev->name); + +#ifndef CONFIG_COVERAGE + while (1) { +#else + for (int i = 0; i < 5; i++) { +#endif + k_sleep(K_MSEC(3000)); + + sensor_sample_fetch(dev); + sensor_channel_get(dev, SENSOR_CHAN_AMBIENT_TEMP, &temp); + sensor_channel_get(dev, SENSOR_CHAN_PRESS, &press); + sensor_channel_get(dev, SENSOR_CHAN_HUMIDITY, &humidity); + sensor_channel_get(dev, SENSOR_CHAN_GAS_RES, &gas_res); + + printf("T: %d.%06d; P: %d.%06d; H: %d.%06d; G: %d.%06d\n", + temp.val1, temp.val2, press.val1, press.val2, + humidity.val1, humidity.val2, gas_res.val1, + gas_res.val2); + } + return 0; +} diff --git a/scripts/ci/tags.yaml b/scripts/ci/tags.yaml index b099a0d3de25..50d4dc1a0337 100644 --- a/scripts/ci/tags.yaml +++ b/scripts/ci/tags.yaml @@ -1523,6 +1523,11 @@ ci_samples_sensor_accel_polling: - nrf/samples/sensor/accel_polling/ - zephyr/samples/sensor/accel_polling/ +ci_samples_sensor_bme680: + files: + - nrf/samples/sensor/bme680/ + - zephyr/samples/sensor/bme680/ + ci_samples_sensor_qdec: files: - nrf/samples/sensor/qdec/