From c6d3d04846b8a5a0e01bcd90ed75c91dac998cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Fri, 22 Nov 2024 15:50:32 +0100 Subject: [PATCH] tests: benchmarks: multicore: Test PM in SPI driver with locks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend test that checks: - current consumption in IDLE, S2RAM when SPIM was used; - SPIM works correctly after leaving low power state. Add test suites where SPI is configured with SPI_HOLD_ON_CS and/or SPI_LOCK_ON. Confirm that SPI CS line activation/deactivation is according to: - SPI_HOLD_ON_CS configuration; - spi_release_dt() calls; - not affected by the Device Runtime Power Management. Signed-off-by: Sebastian Głąb --- .../multicore/idle_spim_loopback/Kconfig | 31 ++- .../idle_spim_loopback/Kconfig.sysbuild | 10 - .../boards/nrf54h20dk_nrf54h20_cpuapp.overlay | 18 ++ .../nrf54h20dk_nrf54h20_cpuapp_fast.overlay | 18 ++ .../multicore/idle_spim_loopback/prj.conf | 3 + .../idle_spim_loopback/prj_s2ram.conf | 1 + .../multicore/idle_spim_loopback/src/main.c | 189 +++++++++++++- .../idle_spim_loopback/sysbuild.cmake | 19 +- .../sysbuild/nrf54h20dk_nrf54h20_cpurad.conf | 1 - .../idle_spim_loopback/testcase.yaml | 244 ++++++++++++++++-- 10 files changed, 477 insertions(+), 57 deletions(-) delete mode 100644 tests/benchmarks/multicore/idle_spim_loopback/Kconfig.sysbuild delete mode 100644 tests/benchmarks/multicore/idle_spim_loopback/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf diff --git a/tests/benchmarks/multicore/idle_spim_loopback/Kconfig b/tests/benchmarks/multicore/idle_spim_loopback/Kconfig index 4dbc860aa4fb..f14517bb87eb 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/Kconfig +++ b/tests/benchmarks/multicore/idle_spim_loopback/Kconfig @@ -5,10 +5,10 @@ # config TEST_SLEEP_DURATION_MS - int "Amount of time (in miliseconds) the core is sleeping" + int "Amount of time (in milliseconds) the core is sleeping" default 1000 help - Set sleep duration to TEST_SLEEP_DURATION_MS miliseconds. + Set sleep duration to TEST_SLEEP_DURATION_MS milliseconds. Based on the value of 'min-residency-us' specified for each power state defined in the DTS, core enters the lowest possible power state. @@ -19,4 +19,31 @@ config DATA_FIELD Set number of bytes exchanged in single spi_transceive() operation. Values from 1 to 16 bytes are confirmed to work correctly. +config TEST_SPI_HOLD_ON_CS + bool "Enable / Disable test for SPI chip select hold" + help + By default, each spi_transceive_dt() activates SPI CS signal before transmission and + deactivates it after the transmission has completed. + When this KConfig is enabled, first SPI transmission activates SPI CS signal and + it is kept active until spi_release() is executed. + +config TEST_SPI_LOCK_ON + bool "Test with SPI lock enabled/disabled" + help + Keep the device locked after the transaction for the current config. + When this KConfig is enabled, SPI device is locked until spi_release() is executed. + +config TEST_SPI_RELEASE_BEFORE_SLEEP + bool "Enable / Disable release of the SPI device" + depends on TEST_SPI_HOLD_ON_CS || TEST_SPI_LOCK_ON + default y + help + When this KConfig is enabled, SPI is released before entering low power state. + When TEST_SPI_HOLD_ON_CS=y and TEST_SPI_RELEASE_BEFORE_SLEEP=y then + each test iteration will see one rising and one falling edge on SPI CS signal. + When TEST_SPI_HOLD_ON_CS=y and TEST_SPI_RELEASE_BEFORE_SLEEP=n then + first test iteration will see SPI CS signal activation. Next test iterations + will NOT observe changes on SPI CS signal. + + source "Kconfig.zephyr" diff --git a/tests/benchmarks/multicore/idle_spim_loopback/Kconfig.sysbuild b/tests/benchmarks/multicore/idle_spim_loopback/Kconfig.sysbuild deleted file mode 100644 index 0898eb292938..000000000000 --- a/tests/benchmarks/multicore/idle_spim_loopback/Kconfig.sysbuild +++ /dev/null @@ -1,10 +0,0 @@ -# -# Copyright (c) 2024 Nordic Semiconductor ASA -# -# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause -# - -source "${ZEPHYR_BASE}/share/sysbuild/Kconfig" - -config REMOTE_BOARD - string "The board used for remote target" diff --git a/tests/benchmarks/multicore/idle_spim_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay b/tests/benchmarks/multicore/idle_spim_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay index 07b8abd49abc..103b7e5bc2a0 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay +++ b/tests/benchmarks/multicore/idle_spim_loopback/boards/nrf54h20dk_nrf54h20_cpuapp.overlay @@ -4,6 +4,23 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +/* Test requires two wire connections: + * - SPIM_MOSI with SPIM_MISO -> P0.07 - P0.06; + * - SPI cs-gpios with test-gpios -> P0.10 - P0.11. + * Test-gpios and cs-gpios must have identical active level flag. + */ + +/ { + zephyr,user { + test-gpios = <&gpio0 11 GPIO_ACTIVE_LOW>; + }; +}; + +&gpiote130 { + status = "okay"; + owned-channels = <0>; +}; + &pinctrl { spi130_default_alt: spi130_default_alt { group1 { @@ -31,6 +48,7 @@ pinctrl-names = "default", "sleep"; overrun-character = <0x00>; memory-regions = <&cpuapp_dma_region>; + cs-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; zephyr,pm-device-runtime-auto; dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; diff --git a/tests/benchmarks/multicore/idle_spim_loopback/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay b/tests/benchmarks/multicore/idle_spim_loopback/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay index 7ed2e7d12eb0..1c3b0c34724e 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay +++ b/tests/benchmarks/multicore/idle_spim_loopback/boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay @@ -4,6 +4,23 @@ * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause */ +/* Test requires two wire connections: + * - SPIM_MOSI with SPIM_MISO -> P7.06 - P7.07; + * - SPI cs-gpios with test-gpios -> P0.10 - P0.11. + * Test-gpios and cs-gpios must have identical active level flag. + */ + +/ { + zephyr,user { + test-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>; + }; +}; + +&gpiote130 { + status = "okay"; + owned-channels = <0>; +}; + &pinctrl { spi120_default: spi120_default { group1 { @@ -36,6 +53,7 @@ pinctrl-names = "default", "sleep"; overrun-character = <0x00>; memory-regions = <&dma_fast_region>; + cs-gpios = <&gpio0 10 GPIO_ACTIVE_HIGH>; zephyr,pm-device-runtime-auto; dut_spi_dt: test-spi-dev@0 { compatible = "vnd,spi-device"; diff --git a/tests/benchmarks/multicore/idle_spim_loopback/prj.conf b/tests/benchmarks/multicore/idle_spim_loopback/prj.conf index d4810cc9657f..a51130229389 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/prj.conf +++ b/tests/benchmarks/multicore/idle_spim_loopback/prj.conf @@ -1,5 +1,8 @@ CONFIG_PRINTK=y CONFIG_LOG=y CONFIG_SPI=y +CONFIG_GPIO=y + +CONFIG_ASSERT=y CONFIG_NRF_REGTOOL_VERBOSITY=1 diff --git a/tests/benchmarks/multicore/idle_spim_loopback/prj_s2ram.conf b/tests/benchmarks/multicore/idle_spim_loopback/prj_s2ram.conf index f4307ccf9693..823e6e086266 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/prj_s2ram.conf +++ b/tests/benchmarks/multicore/idle_spim_loopback/prj_s2ram.conf @@ -17,4 +17,5 @@ CONFIG_UART_CONSOLE=n CONFIG_SERIAL=n CONFIG_SPI=y +CONFIG_GPIO=y CONFIG_ASSERT=y diff --git a/tests/benchmarks/multicore/idle_spim_loopback/src/main.c b/tests/benchmarks/multicore/idle_spim_loopback/src/main.c index 29e24d3ad38b..82e60cc57b0c 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/src/main.c +++ b/tests/benchmarks/multicore/idle_spim_loopback/src/main.c @@ -8,17 +8,30 @@ LOG_MODULE_REGISTER(idle_spim_loopback, LOG_LEVEL_INF); #include +#include #include #include #include #define DELTA (1) -#define SPI_MODE (SPI_OP_MODE_MASTER | SPI_WORD_SET(8) | SPI_LINES_SINGLE | SPI_TRANSFER_MSB \ - | SPI_MODE_CPHA | SPI_MODE_CPOL) +#define SPI_MODE_DEFAULT (SPI_OP_MODE_MASTER | SPI_WORD_SET(8) | SPI_LINES_SINGLE \ + | SPI_TRANSFER_MSB | SPI_MODE_CPHA | SPI_MODE_CPOL) + +#if defined(CONFIG_TEST_SPI_HOLD_ON_CS) && defined(CONFIG_TEST_SPI_LOCK_ON) +#define SPI_MODE (SPI_MODE_DEFAULT | SPI_HOLD_ON_CS | SPI_LOCK_ON) +#elif defined(CONFIG_TEST_SPI_HOLD_ON_CS) && !defined(CONFIG_TEST_SPI_LOCK_ON) +#define SPI_MODE (SPI_MODE_DEFAULT | SPI_HOLD_ON_CS) +#elif !defined(CONFIG_TEST_SPI_HOLD_ON_CS) && defined(CONFIG_TEST_SPI_LOCK_ON) +#define SPI_MODE (SPI_MODE_DEFAULT | SPI_LOCK_ON) +#else +#define SPI_MODE (SPI_MODE_DEFAULT) +#endif static struct spi_dt_spec spim_spec = SPI_DT_SPEC_GET(DT_NODELABEL(dut_spi_dt), SPI_MODE, 0); +static const struct gpio_dt_spec pin_in = GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), test_gpios); + #define MEMORY_SECTION(node) \ COND_CODE_1(DT_NODE_HAS_PROP(node, memory_regions), \ (__attribute__((__section__( \ @@ -28,15 +41,35 @@ static struct spi_dt_spec spim_spec = SPI_DT_SPEC_GET(DT_NODELABEL(dut_spi_dt), static uint8_t spim_buffer[2 * CONFIG_DATA_FIELD] MEMORY_SECTION(DT_BUS(DT_NODELABEL(dut_spi_dt))); +/* Variables used to count edges on SPI CS */ +static struct gpio_callback gpio_input_cb_data; +static volatile uint32_t high, low; + /* Variables used to make SPI active for ~1 second */ static struct k_timer my_timer; static bool timer_expired; + void my_timer_handler(struct k_timer *dummy) { timer_expired = true; } +void gpio_input_edge_callback(const struct device *dev, struct gpio_callback *cb, uint32_t pins) +{ + uint32_t pin = 0; + + while (pins >>= 1) { + pin++; + } + + /* Get pin RAW to confirm pin polarity */ + if (gpio_pin_get_raw(dev, pin)) { + high++; + } else { + low++; + } +} int main(void) { @@ -64,41 +97,86 @@ int main(void) .count = 1 }; - LOG_INF("%s runs as a SPI HOST", CONFIG_BOARD_TARGET); + LOG_INF("Multicore idle_spi_loopback test on %s", CONFIG_BOARD_TARGET); + LOG_INF("Core will sleep for %u ms", CONFIG_TEST_SLEEP_DURATION_MS); + LOG_INF("Testing SPIM device %s", spim_spec.bus->name); + LOG_INF("GPIO loopback at %s, pin %d", pin_in.port->name, pin_in.pin); LOG_INF("%d bytes of data exchanged at once", CONFIG_DATA_FIELD); +#if defined(CONFIG_TEST_SPI_HOLD_ON_CS) + LOG_INF("SPI CS lock enabled"); +#endif +#if defined(CONFIG_TEST_SPI_LOCK_ON) + LOG_INF("SPI LOCK enabled"); +#endif +#if !defined(CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP) + LOG_INF("SPI is never released"); +#endif + LOG_INF("==================================================================="); ret = spi_is_ready_dt(&spim_spec); if (!ret) { LOG_ERR("Error: SPI device is not ready"); } - __ASSERT(ret, "Error: SPI device is not ready\n"); + __ASSERT_NO_MSG(ret); + + ret = gpio_is_ready_dt(&pin_in); + if (!ret) { + LOG_ERR("Device %s is not ready.", pin_in.port->name); + } + __ASSERT_NO_MSG(ret); + + /* Configure gpio and init GPIOTE callback. */ + ret = gpio_pin_configure_dt(&pin_in, GPIO_INPUT); + if (ret) { + LOG_ERR("gpio_pin_configure_dt() has failed (%d)", ret); + } + __ASSERT_NO_MSG(ret == 0); + + gpio_init_callback(&gpio_input_cb_data, gpio_input_edge_callback, BIT(pin_in.pin)); k_timer_init(&my_timer, my_timer_handler, NULL); - /* Run test forever */ + /* Run test forever. */ while (1) { test_pass = true; timer_expired = false; - /* start a one-shot timer that expires after 1 second */ + /* Clear edge counters. */ + high = 0; + low = 0; + + /* Start a one-shot timer that expires after 1 second. */ k_timer_start(&my_timer, K_MSEC(1000), K_NO_WAIT); - /* SPI active transmissions for ~ 1 second */ + /* Configure and enable GPIOTE. */ + ret = gpio_pin_interrupt_configure_dt(&pin_in, GPIO_INT_EDGE_BOTH); + if (ret) { + LOG_ERR("gpio_pin_interrupt_configure_dt() has failed (%d)", ret); + } + __ASSERT_NO_MSG(ret == 0); + + ret = gpio_add_callback(pin_in.port, &gpio_input_cb_data); + if (ret) { + LOG_ERR("gpio_add_callback() has failed (%d)", ret); + } + __ASSERT_NO_MSG(ret == 0); + + /* SPI active transmissions for ~ 1 second. */ while (!timer_expired) { - /* Generate pseudo random tx_data for current test */ + /* Generate pseudo random tx_data for current test. */ for (int i = 0; i < CONFIG_DATA_FIELD; i++) { *((uint8_t *) tx_spi_buf.buf + i) = acc; acc += DELTA; } - /* Transmit data */ + /* Transmit data. */ ret = spi_transceive_dt(&spim_spec, &tx_spi_buf_set, &rx_spi_buf_set); if (ret != 0) { LOG_ERR("spi_transceive_dt, err: %d", ret); } __ASSERT(ret == 0, "Error: spi_transceive_dt, err: %d\n", ret); - /* Check if the received data is consistent with the data sent */ + /* Check if the received data is consistent with the data sent. */ for (int i = 0; i < CONFIG_DATA_FIELD; i++) { uint8_t received = *((uint8_t *) rx_spi_buf.buf + i); uint8_t transmitted = *((uint8_t *) tx_spi_buf.buf + i); @@ -110,17 +188,100 @@ int main(void) __ASSERT(false, "Run %d - FAILED\n", counter); } } + +#if defined(CONFIG_TEST_SPI_HOLD_ON_CS) + /* At least one SPI transmission has already happened. + * When SPI is configured with SPI_HOLD_ON_CS + * then SPI CS signal shall be active here. + */ + int temp_pin_value = gpio_pin_get_raw(pin_in.port, pin_in.pin); + int expected_pin_value; + + if (pin_in.dt_flags & GPIO_ACTIVE_LOW) { + /* GPIO_ACTIVE_LOW */ + expected_pin_value = 0; + } else { + /* GPIO_ACTIVE_HIGH */ + expected_pin_value = 1; + } + + if (temp_pin_value != expected_pin_value) { + LOG_ERR("SPI CS signal is %d, while expected is %d", + temp_pin_value, expected_pin_value); + } + __ASSERT_NO_MSG(temp_pin_value == expected_pin_value); +#endif } /* while (!timer_expired) */ - /* Report if communication was successful */ +#if defined(CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP) + /* Release SPI Chip Select / SPI device. */ + ret = spi_release_dt(&spim_spec); + if (ret != 0) { + LOG_ERR("spi_release_dt(), err: %d", ret); + } + __ASSERT_NO_MSG(ret == 0); +#endif + + /* Disable GPIOTE interrupt. */ + ret = gpio_remove_callback(pin_in.port, &gpio_input_cb_data); + if (ret) { + LOG_ERR("gpio_remove_callback() has failed (%d)", ret); + } + __ASSERT_NO_MSG(ret == 0); + + ret = gpio_pin_interrupt_configure_dt(&pin_in, GPIO_INT_DISABLE | + GPIO_INT_LEVELS_LOGICAL | GPIO_INT_HIGH_1); + if (ret) { + LOG_ERR("gpio_pin_interrupt_configure_dt() has failed (%d)", ret); + } + __ASSERT_NO_MSG(ret == 0); + + /* Report if communication was successful. */ if (test_pass) { - LOG_INF("Run %d - PASS", counter); + LOG_INF("Run %d - PASS; rising: %u, falling %u", counter, high, low); + } else { + LOG_INF("Run %d - FAILED; rising: %u, falling %u", counter, high, low); + } + +#if defined(CONFIG_TEST_SPI_HOLD_ON_CS) + /* When SPI is configured with SPI_HOLD_ON_CS: + * - first spi_transceive_dt() activates SPI CS signal; + * - following spi_transceive_dt() calls don't change SPI CS state; + * - SPI CS signal is deactivated by spi_release_dt(). + */ +#if defined(CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP) + /* Every test iteration will see one SPI CS activation and one deactivation. */ + __ASSERT_NO_MSG(high == 1); + __ASSERT_NO_MSG(low == 1); +#else /* defined(CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP) */ + /* SPI CS gets activated in the first iteration and stays active forever. */ + if (counter == 0) { + /* Observed edge depends on GPIO polarity. */ + if (pin_in.dt_flags & GPIO_ACTIVE_LOW) { + /* GPIO_ACTIVE_LOW */ + __ASSERT_NO_MSG(high == 0); + __ASSERT_NO_MSG(low == 1); + } else { + /* GPIO_ACTIVE_HIGH */ + __ASSERT_NO_MSG(high == 1); + __ASSERT_NO_MSG(low == 0); + } } else { - LOG_INF("Run %d - FAILED", counter); + __ASSERT_NO_MSG(high == 0); + __ASSERT_NO_MSG(low == 0); } +#endif /* defined(CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP) */ +#else + /* SPI was active for ~1 second with separate SPI CS activations + * for each spi_transceive_dt() call. + */ + __ASSERT_NO_MSG(high >= 1000); + __ASSERT_NO_MSG(low >= 1000); + __ASSERT_NO_MSG(low == high); +#endif counter++; - /* Sleep / enter low power state */ + /* Sleep / enter low power state. */ k_msleep(CONFIG_TEST_SLEEP_DURATION_MS); } diff --git a/tests/benchmarks/multicore/idle_spim_loopback/sysbuild.cmake b/tests/benchmarks/multicore/idle_spim_loopback/sysbuild.cmake index 731722ace53c..4b59a0784f26 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/sysbuild.cmake +++ b/tests/benchmarks/multicore/idle_spim_loopback/sysbuild.cmake @@ -4,19 +4,12 @@ # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause # -if("${SB_CONFIG_REMOTE_BOARD}" STREQUAL "") - message(FATAL_ERROR "REMOTE_BOARD must be set to a valid board name") -endif() - -# Add remote project -ExternalZephyrProject_Add( +if(SB_CONFIG_SOC_NRF54H20) + # Add remote project + ExternalZephyrProject_Add( APPLICATION remote - SOURCE_DIR ${APP_DIR}/../../power_consumption/common/remote_sleep_forever - BOARD ${SB_CONFIG_REMOTE_BOARD} + SOURCE_DIR ${SYSBUILD_NRF_MODULE_DIR}/tests/benchmarks/power_consumption/common/remote_sleep_forever + BOARD ${SB_CONFIG_BOARD}/${SB_CONFIG_SOC}/cpurad BOARD_REVISION ${BOARD_REVISION} ) - -# Add a dependency so that the remote image will be built and flashed first -add_dependencies(idle_spim_loopback remote) -# Add dependency so that the remote image is flashed first. -sysbuild_add_dependencies(FLASH idle_spim_loopback remote) +endif() diff --git a/tests/benchmarks/multicore/idle_spim_loopback/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf b/tests/benchmarks/multicore/idle_spim_loopback/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf deleted file mode 100644 index dd863e78d993..000000000000 --- a/tests/benchmarks/multicore/idle_spim_loopback/sysbuild/nrf54h20dk_nrf54h20_cpurad.conf +++ /dev/null @@ -1 +0,0 @@ -SB_CONFIG_REMOTE_BOARD="nrf54h20dk/nrf54h20/cpurad" diff --git a/tests/benchmarks/multicore/idle_spim_loopback/testcase.yaml b/tests/benchmarks/multicore/idle_spim_loopback/testcase.yaml index c5e43cbd2aa7..2f715492553f 100644 --- a/tests/benchmarks/multicore/idle_spim_loopback/testcase.yaml +++ b/tests/benchmarks/multicore/idle_spim_loopback/testcase.yaml @@ -13,15 +13,13 @@ tests: # benchmarks.multicore.idle_spim_loopback.4_bytes.no_sleep: - extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf harness: console harness_config: fixture: spi_loopback type: multi_line ordered: true regex: - - ".*runs as a SPI HOST" + - "Multicore idle_spi_loopback test on" - "4 bytes of data exchanged at once" - ".*Run 0 - PASS" - ".*Run 1 - PASS" @@ -29,7 +27,6 @@ tests: benchmarks.multicore.idle_spim_loopback.4_bytes.idle: tags: ppk_power_measure extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_CONF_FILE=prj_s2ram.conf idle_spim_loopback_CONFIG_TEST_SLEEP_DURATION_MS=500 harness: pytest @@ -41,7 +38,6 @@ tests: benchmarks.multicore.idle_spim_loopback.4_bytes.s2ram: tags: ppk_power_measure extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_CONF_FILE=prj_s2ram.conf harness: pytest harness_config: @@ -51,7 +47,6 @@ tests: benchmarks.multicore.idle_spim_loopback.4_bytes.no_sleep_fast: extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" harness: console harness_config: @@ -59,7 +54,7 @@ tests: type: multi_line ordered: true regex: - - ".*runs as a SPI HOST" + - "Multicore idle_spi_loopback test on" - "4 bytes of data exchanged at once" - ".*Run 0 - PASS" - ".*Run 1 - PASS" @@ -67,7 +62,6 @@ tests: benchmarks.multicore.idle_spim_loopback.4_bytes.idle_fast: tags: ppk_power_measure extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_CONF_FILE=prj_s2ram.conf idle_spim_loopback_CONFIG_TEST_SLEEP_DURATION_MS=500 idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" @@ -80,7 +74,6 @@ tests: benchmarks.multicore.idle_spim_loopback.4_bytes.s2ram_fast: tags: ppk_power_measure extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_CONF_FILE=prj_s2ram.conf idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" harness: pytest @@ -95,7 +88,6 @@ tests: benchmarks.multicore.idle_spim_loopback.16_bytes.no_sleep: extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_CONFIG_DATA_FIELD=16 harness: console harness_config: @@ -103,7 +95,7 @@ tests: type: multi_line ordered: true regex: - - ".*runs as a SPI HOST" + - "Multicore idle_spi_loopback test on" - "16 bytes of data exchanged at once" - ".*Run 0 - PASS" - ".*Run 1 - PASS" @@ -111,7 +103,6 @@ tests: benchmarks.multicore.idle_spim_loopback.16_bytes.idle: tags: ppk_power_measure extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_CONF_FILE=prj_s2ram.conf idle_spim_loopback_CONFIG_TEST_SLEEP_DURATION_MS=500 idle_spim_loopback_CONFIG_DATA_FIELD=16 @@ -124,7 +115,6 @@ tests: benchmarks.multicore.idle_spim_loopback.16_bytes.s2ram: tags: ppk_power_measure extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_CONF_FILE=prj_s2ram.conf idle_spim_loopback_CONFIG_DATA_FIELD=16 harness: pytest @@ -135,7 +125,6 @@ tests: benchmarks.multicore.idle_spim_loopback.16_bytes.no_sleep_fast: extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" idle_spim_loopback_CONFIG_DATA_FIELD=16 harness: console @@ -144,7 +133,7 @@ tests: type: multi_line ordered: true regex: - - ".*runs as a SPI HOST" + - "Multicore idle_spi_loopback test on" - "16 bytes of data exchanged at once" - ".*Run 0 - PASS" - ".*Run 1 - PASS" @@ -152,7 +141,6 @@ tests: benchmarks.multicore.idle_spim_loopback.16_bytes.idle_fast: tags: ppk_power_measure extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_CONF_FILE=prj_s2ram.conf idle_spim_loopback_CONFIG_TEST_SLEEP_DURATION_MS=500 idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" @@ -166,7 +154,6 @@ tests: benchmarks.multicore.idle_spim_loopback.16_bytes.s2ram_fast: tags: ppk_power_measure extra_args: - SB_CONF_FILE=sysbuild/nrf54h20dk_nrf54h20_cpurad.conf idle_spim_loopback_CONF_FILE=prj_s2ram.conf idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" idle_spim_loopback_CONFIG_DATA_FIELD=16 @@ -175,3 +162,226 @@ tests: fixture: spi_loopback pytest_root: - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" + + # + # 4 Bytes of data with SPI Chip Select Lock enabled + # + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_lock.s2ram_fast: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" + + # + # 4 Bytes of data with SPI Lock enabled + # + + benchmarks.multicore.idle_spim_loopback.4_bytes_spi_lock.s2ram_fast: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" + + # + # 4 Bytes of data with SPI Chip Select Lock enabled and SPI Lock enabled + # + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.no_sleep: + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + harness: console + harness_config: + fixture: spi_loopback + type: multi_line + ordered: true + regex: + - "Multicore idle_spi_loopback test on" + - "4 bytes of data exchanged at once" + - "SPI CS lock enabled" + - "SPI LOCK enabled" + - ".*Run 0 - PASS" + - ".*Run 1 - PASS" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.idle: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + idle_spim_loopback_CONFIG_TEST_SLEEP_DURATION_MS=500 + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.s2ram: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.no_sleep_fast: + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" + harness: console + harness_config: + fixture: spi_loopback + type: multi_line + ordered: true + regex: + - "Multicore idle_spi_loopback test on" + - "4 bytes of data exchanged at once" + - "SPI CS lock enabled" + - "SPI LOCK enabled" + - ".*Run 0 - PASS" + - ".*Run 1 - PASS" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.idle_fast: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + idle_spim_loopback_CONFIG_TEST_SLEEP_DURATION_MS=500 + idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock.s2ram_fast: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" + + # + # 4 Bytes of data with SPI Chip Select Lock enabled and SPI Lock + # No SPI release + # + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.no_sleep: + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP=n + harness: console + harness_config: + fixture: spi_loopback + type: multi_line + ordered: true + regex: + - "Multicore idle_spi_loopback test on" + - "4 bytes of data exchanged at once" + - "SPI CS lock enabled" + - "SPI LOCK enabled" + - "SPI is never released" + - ".*Run 0 - PASS" + - ".*Run 1 - PASS" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.idle: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP=n + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + idle_spim_loopback_CONFIG_TEST_SLEEP_DURATION_MS=500 + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.s2ram: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP=n + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.no_sleep_fast: + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP=n + idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" + harness: console + harness_config: + fixture: spi_loopback + type: multi_line + ordered: true + regex: + - "Multicore idle_spi_loopback test on" + - "4 bytes of data exchanged at once" + - "SPI CS lock enabled" + - "SPI LOCK enabled" + - "SPI is never released" + - ".*Run 0 - PASS" + - ".*Run 1 - PASS" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.idle_fast: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP=n + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + idle_spim_loopback_CONFIG_TEST_SLEEP_DURATION_MS=500 + idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_idle" + + benchmarks.multicore.idle_spim_loopback.4_bytes_cs_and_spi_lock_no_release.s2ram_fast: + tags: ppk_power_measure + extra_args: + idle_spim_loopback_CONFIG_TEST_SPI_HOLD_ON_CS=y + idle_spim_loopback_CONFIG_TEST_SPI_LOCK_ON=y + idle_spim_loopback_CONFIG_TEST_SPI_RELEASE_BEFORE_SLEEP=n + idle_spim_loopback_CONF_FILE=prj_s2ram.conf + idle_spim_loopback_DTC_OVERLAY_FILE="boards/nrf54h20dk_nrf54h20_cpuapp_fast.overlay" + harness: pytest + harness_config: + fixture: spi_loopback + pytest_root: + - "${CUSTOM_ROOT_TEST_DIR}/test_measure_power_consumption.py::test_measure_and_data_dump_pwm_and_s2ram"