Skip to content

Commit 2545d8b

Browse files
mstasiaknordicrlubos
authored andcommitted
tests: drivers: i2c_pan: change expected error
Transaction timeout should be reported by timeout error code. Reworked test to expect a fail at the end because no fix will be provided in drivers. Signed-off-by: Michał Stasiak <michal.stasiak@nordicsemi.no>
1 parent df4bd44 commit 2545d8b

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

tests/drivers/i2c/i2c_pan/src/main.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,17 @@ ZTEST(i2c_pan, test_clock_stretching_recovery)
128128
zassert_ok(ret, "i2c_read failed: %d\n", ret);
129129
zassert_mem_equal(fixture.master_buffer, fixture.slave_buffer, TEST_BUFFER_SIZE);
130130

131-
TC_PRINT("STEP 2: TWIM - TWIS transmission with SCL pulled low (EIO error is expected)\n");
131+
TC_PRINT("STEP 2: TWIM - TWIS transmission with SCL pulled low "
132+
"(ETIMEDOUT error is expected)\n");
132133
/* Pull TWIS SCL pin low */
133134
nrf_twis_scl_pin_set(twis.p_reg, 1 << 31);
134135
nrf_gpio_cfg_output(scl_pin);
135136
nrf_gpio_pin_clear(scl_pin);
136137
TC_PRINT("TWIS SCL pin (disconnected): 0x%x\n", nrf_twis_scl_pin_get(twis.p_reg));
137138
memset(fixture.slave_buffer, 0, TEST_BUFFER_SIZE);
138139
ret = i2c_read(fixture.dev, fixture.master_buffer, TEST_BUFFER_SIZE, fixture.addr);
139-
zassert_equal(ret, -EIO, "i2c_read failed with different error than expeced (EIO) %d\n",
140-
ret);
140+
zassert_equal(ret, -ETIMEDOUT,
141+
"i2c_read failed with different error than expeced (ETIMEDOUT) %d\n", ret);
141142

142143
TC_PRINT("STEP 3: TWIM - TWIS transmission after TWIS pin reconfiguration\n");
143144
/* Restore original TWIS pin configuration */
@@ -146,9 +147,16 @@ ZTEST(i2c_pan, test_clock_stretching_recovery)
146147
zassert_ok(ret);
147148
TC_PRINT("TWIS SCL pin (reconfigured): 0x%x\n", nrf_twis_scl_pin_get(twis.p_reg));
148149

150+
/* Attempt proper transfer, expected to fail on devices affected by nRf54L anomaly 105. */
149151
ret = i2c_read(fixture.dev, fixture.master_buffer, TEST_BUFFER_SIZE, fixture.addr);
150-
zassert_ok(ret, "i2c_read failed (after SCL release): %d\n", ret);
151-
zassert_mem_equal(fixture.master_buffer, fixture.slave_buffer, TEST_BUFFER_SIZE);
152+
if (NRF_ERRATA_DYNAMIC_CHECK(54L, 105)) {
153+
zassert_equal(ret, -ETIMEDOUT,
154+
"i2c_read failed with different error than expeced (ETIMEDOUT) %d\n",
155+
ret);
156+
} else {
157+
zassert_ok(ret, "i2c_read failed (after SCL release): %d\n", ret);
158+
zassert_mem_equal(fixture.master_buffer, fixture.slave_buffer, TEST_BUFFER_SIZE);
159+
}
152160
}
153161

154162
ZTEST_SUITE(i2c_pan, NULL, test_setup, NULL, cleanup_buffers, NULL);

west.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ manifest:
6565
# https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/modules.html
6666
- name: zephyr
6767
repo-path: sdk-zephyr
68-
revision: pull/3864/head
68+
revision: 52c60f297ee16846ca4410ef3c345db57d4999a8
6969
import:
7070
# In addition to the zephyr repository itself, NCS also
7171
# imports the contents of zephyr/west.yml at the above

0 commit comments

Comments
 (0)