-
Notifications
You must be signed in to change notification settings - Fork 1.4k
test: zephyr: add nrf7120 i2c testcase #25087
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
Open
travis3630
wants to merge
1
commit into
nrfconnect:main
Choose a base branch
from
travis3630:WZN-2251-nrf7120-add-testcase-twi-i2c
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
samples/zephyr/drivers/i2c/rtio_loopback/boards/nrf7120pdk_nrf7120_cpuapp.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Copyright (c) 2025 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
|
||
CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 |
67 changes: 67 additions & 0 deletions
67
samples/zephyr/drivers/i2c/rtio_loopback/boards/nrf7120pdk_nrf7120_cpuapp.overlay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/* | ||
* SDA = P1.8 and P1.9 | ||
* SCL = P1.14 and P1.15 | ||
*/ | ||
|
||
/ { | ||
aliases { | ||
i2c-controller = &i2c21; | ||
i2c-controller-target = &i2c22; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
i2c21_default: i2c21_default { | ||
group1 { | ||
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>, | ||
<NRF_PSEL(TWIS_SCL, 1, 14)>; | ||
bias-pull-up; | ||
}; | ||
}; | ||
|
||
i2c21_sleep: i2c21_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>, | ||
<NRF_PSEL(TWIS_SCL, 1, 14)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
|
||
i2c22_default: i2c22_default { | ||
group1 { | ||
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>, | ||
<NRF_PSEL(TWIS_SCL, 1, 15)>; | ||
bias-pull-up; | ||
}; | ||
}; | ||
|
||
i2c22_sleep: i2c22_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>, | ||
<NRF_PSEL(TWIS_SCL, 1, 15)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
&i2c21 { | ||
pinctrl-0 = <&i2c21_default>; | ||
pinctrl-1 = <&i2c21_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
zephyr,concat-buf-size = <256>; | ||
status = "okay"; | ||
}; | ||
|
||
&i2c22 { | ||
compatible = "nordic,nrf-twis"; | ||
pinctrl-0 = <&i2c22_default>; | ||
pinctrl-1 = <&i2c22_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
status = "okay"; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,8 @@ tests: | |
- [email protected]/nrf54ls05b/cpuapp | ||
- nrf54lv10dk/nrf54lv10a/cpuapp | ||
- [email protected]/nrf54lv10a/cpuapp | ||
- nrf7120pdk/nrf7120/cpuapp | ||
integration_platforms: | ||
- nrf54ls05dk/nrf54ls05b/cpuapp | ||
- nrf54lv10dk/nrf54lv10a/cpuapp | ||
- nrf7120pdk/nrf7120/cpuapp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CONFIG_NRFX_TWIS22=y |
61 changes: 61 additions & 0 deletions
61
tests/zephyr/boards/nrf/i2c/i2c_slave/boards/nrf7120pdk_nrf7120_cpuapp.overlay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/ { | ||
aliases { | ||
i2c-slave = &i2c22; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
i2c21_default_alt: i2c21_default_alt { | ||
group1 { | ||
psels = <NRF_PSEL(TWIM_SDA, 1, 8)>, | ||
<NRF_PSEL(TWIM_SCL, 1, 14)>; | ||
}; | ||
}; | ||
|
||
i2c21_sleep_alt: i2c21_sleep_alt { | ||
group1 { | ||
psels = <NRF_PSEL(TWIM_SDA, 1, 8)>, | ||
<NRF_PSEL(TWIM_SCL, 1, 14)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
|
||
i2c22_default_alt: i2c22_default_alt { | ||
group1 { | ||
/* Temporary workaround as it is currently not possible | ||
* to configure pins for TWIS with pinctrl. | ||
*/ | ||
psels = <NRF_PSEL(TWIM_SDA, 1, 9)>, | ||
<NRF_PSEL(TWIM_SCL, 1, 15)>; | ||
bias-pull-up; | ||
}; | ||
}; | ||
|
||
i2c22_sleep_alt: i2c22_sleep_alt { | ||
group1 { | ||
psels = <NRF_PSEL(TWIM_SDA, 1, 9)>, | ||
<NRF_PSEL(TWIM_SCL, 1, 15)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
dut_twim: &i2c21 { | ||
compatible = "nordic,nrf-twim"; | ||
status = "okay"; | ||
pinctrl-0 = <&i2c21_default_alt>; | ||
pinctrl-1 = <&i2c21_sleep_alt>; | ||
pinctrl-names = "default", "sleep"; | ||
clock-frequency = <I2C_BITRATE_STANDARD>; | ||
sensor: sensor@54 { | ||
reg = <0x54>; | ||
}; | ||
}; | ||
|
||
&i2c22 { | ||
compatible = "nordic,nrf-twis"; | ||
status = "okay"; | ||
pinctrl-0 = <&i2c22_default_alt>; | ||
pinctrl-1 = <&i2c22_sleep_alt>; | ||
pinctrl-names = "default", "sleep"; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ tests: | |
- nrf54ls05dk/nrf54ls05b/cpuapp | ||
- nrf54lv10dk/nrf54lv10a/cpuapp | ||
- [email protected]/nrf54lv10a/cpuapp | ||
- nrf7120pdk/nrf7120/cpuapp | ||
integration_platforms: | ||
- nrf54ls05dk/nrf54ls05b/cpuapp | ||
- nrf54lv10dk/nrf54lv10a/cpuapp | ||
- nrf7120pdk/nrf7120/cpuapp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# | ||
# 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_api) | ||
|
||
FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/drivers/i2c/i2c_nrfx_twim/src/*.c) | ||
target_sources(app PRIVATE ${app_sources}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
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_nrfx_twim. |
68 changes: 68 additions & 0 deletions
68
tests/zephyr/drivers/i2c/i2c_nrfx_twim/boards/nrf7120pdk_nrf7120_cpuapp.overlay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/* | ||
* Copyright (c) 2025 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/* | ||
* SDA = P1.8 and P1.9 | ||
* SCL = P1.14 and P1.15 | ||
*/ | ||
|
||
/ { | ||
aliases { | ||
i2c-controller = &i2c21; | ||
i2c-controller-target = &i2c22; | ||
}; | ||
}; | ||
|
||
&pinctrl { | ||
i2c21_default: i2c21_default { | ||
group1 { | ||
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>, | ||
<NRF_PSEL(TWIS_SCL, 1, 14)>; | ||
bias-pull-up; | ||
}; | ||
}; | ||
|
||
i2c21_sleep: i2c21_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(TWIS_SDA, 1, 8)>, | ||
<NRF_PSEL(TWIS_SCL, 1, 14)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
|
||
i2c22_default: i2c22_default { | ||
group1 { | ||
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>, | ||
<NRF_PSEL(TWIS_SCL, 1, 15)>; | ||
bias-pull-up; | ||
}; | ||
}; | ||
|
||
i2c22_sleep: i2c22_sleep { | ||
group1 { | ||
psels = <NRF_PSEL(TWIS_SDA, 1, 9)>, | ||
<NRF_PSEL(TWIS_SCL, 1, 15)>; | ||
low-power-enable; | ||
}; | ||
}; | ||
}; | ||
|
||
&i2c21 { | ||
compatible = "nordic,nrf-twim"; | ||
pinctrl-0 = <&i2c21_default>; | ||
pinctrl-1 = <&i2c21_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
zephyr,concat-buf-size = <256>; | ||
status = "okay"; | ||
}; | ||
|
||
&i2c22 { | ||
compatible = "nordic,nrf-twis"; | ||
pinctrl-0 = <&i2c22_default>; | ||
pinctrl-1 = <&i2c22_sleep>; | ||
pinctrl-names = "default", "sleep"; | ||
status = "okay"; | ||
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
CONFIG_ZTEST=y | ||
CONFIG_BOOT_BANNER=n | ||
|
||
CONFIG_LOG=y | ||
CONFIG_I2C_LOG_LEVEL_INF=y | ||
CONFIG_I2C=y | ||
CONFIG_I2C_TARGET=y | ||
CONFIG_I2C_TARGET_BUFFER_MODE=y | ||
CONFIG_I2C_NRFX_TWIS_BUF_SIZE=256 | ||
|
||
CONFIG_ZERO_LATENCY_IRQS=y |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
common: | ||
depends_on: i2c | ||
tags: | ||
- drivers | ||
- i2c | ||
- ci_tests_zephyr_drivers_i2c_i2c_nrfx_twim | ||
harness: ztest | ||
harness_config: | ||
fixture: i2c_bus_short | ||
|
||
tests: | ||
drivers.i2c.nrfx_twim_async_api.extended: | ||
platform_allow: | ||
- nrf7120pdk/nrf7120/cpuapp | ||
integration_platforms: | ||
- nrf7120pdk/nrf7120/cpuapp |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.