Skip to content

Commit 68db5f3

Browse files
[nrf fromtree] tests: drivers: spi: loopback: wait for idle before timed test
Wait a bit before performing timed spi_loopback_transceive() in test_spi_complete_multiple_timed to ensure the console is idle, otherwise the console completing and suspending in the "background" near the end of the spi transaction can introduce latency. Signed-off-by: Bjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no> (cherry picked from commit 5dec22a)
1 parent 62755cb commit 68db5f3

File tree

1 file changed

+7
-1
lines changed
  • tests/drivers/spi/spi_loopback/src

1 file changed

+7
-1
lines changed

tests/drivers/spi/spi_loopback/src/spi.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,13 @@ ZTEST(spi_loopback, test_spi_complete_multiple_timed)
315315
*/
316316
zassert_ok(pm_device_runtime_get(spec->bus));
317317

318-
/* since this is a test program, there shouldn't be much to interfere with measurement */
318+
/*
319+
* since this is a test program, there shouldn't be much to interfere with measurement.
320+
* still let's wait for the console to complete printing so it does not complete and
321+
* suspend near the end of the spi transaction.
322+
*/
323+
k_msleep(10);
324+
319325
start_time = k_cycle_get_32();
320326
spi_loopback_transceive(spec, &tx, &rx, 2);
321327
end_time = k_cycle_get_32();

0 commit comments

Comments
 (0)