Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: drivers: Add QSPI driver test with single line mode #21061

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,7 @@
/tests/drivers/uart/ @nrfconnect/ncs-low-level-test
/tests/drivers/sensor/multicore_temp/ @nrfconnect/ncs-low-level-test
/tests/drivers/sdp_asm/ @nrfconnect/ncs-low-level-test @nrfconnect/ncs-ll-ursus
/tests/drivers/nrf_qspi_flash/ @nrfconnect/ncs-low-level-test
/tests/lib/at_cmd_parser/ @nrfconnect/ncs-modem
/tests/lib/at_cmd_custom/ @nrfconnect/ncs-modem
/tests/lib/at_parser/ @nrfconnect/ncs-modem
Expand Down
1 change: 1 addition & 0 deletions scripts/ci/tags.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,7 @@ ci_tests_drivers_flash:
- nrf/tests/drivers/flash/
- nrfxlib/nrf_rpc/
- zephyr/drivers/flash/
- nrf/tests/drivers/nrf_qspi_flash/

ci_tests_unity:
files:
Expand Down
13 changes: 13 additions & 0 deletions tests/drivers/nrf_qspi_flash/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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(nrf_qspi_flash)

target_sources(app PRIVATE ${ZEPHYR_BASE}/samples/drivers/spi_flash/src/main.c)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
*/

&mx25r64 {
status="okay";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spaces lacking

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What tab size is required ?

readoc="fastread";
writeoc="pp";
};
8 changes: 8 additions & 0 deletions tests/drivers/nrf_qspi_flash/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CONFIG_FLASH=y
CONFIG_ASSERT=y

CONFIG_PRINTK=y
CONFIG_LOG=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
46 changes: 46 additions & 0 deletions tests/drivers/nrf_qspi_flash/testcase.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
common:
sysbuild: true
depends_on: spi

tests:
tests.drivers.nrf_qspi_flash.qspi_multi_line_mode:
tags:
- ci_tests_drivers_flash
- drivers
- flash
- spi
platform_allow:
- nrf52840dk/nrf52840
- nrf5340dk/nrf5340/cpuapp
integration_platforms:
- nrf52840dk/nrf52840
- nrf5340dk/nrf5340/cpuapp
harness: console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the point in this being added to sdk-nrf, add it to upstream zephyr instead?

Copy link
Contributor Author

@nordic-bami nordic-bami Mar 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case is NRF specific and related to NRF devices only past driver bug

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes? You can add a nordic specific test upstream, nrf_qspi_flash is a nordic driver, it won't run on e.g. stm32 platforms

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do this, but what is the point ? It will be slower and maintaining it will be more complicated

harness_config:
type: multi_line
ordered: true
regex:
- ".*Flash erase succeeded.*"
- ".*Data read matches data written. Good.*"

tests.drivers.nrf_qspi_flash.qspi_single_line_mode:
tags:
- ci_tests_drivers_flash
- drivers
- flash
- spi
platform_allow:
- nrf52840dk/nrf52840
- nrf5340dk/nrf5340/cpuapp
integration_platforms:
- nrf52840dk/nrf52840
- nrf5340dk/nrf5340/cpuapp
extra_args:
- EXTRA_DTC_OVERLAY_FILE="flash_cfg/mx25r64_single_line.overlay"
harness: console
harness_config:
type: multi_line
ordered: true
regex:
- ".*Flash erase succeeded.*"
- ".*Data read matches data written. Good.*"