Skip to content
Commit 39233656 authored by Bjarki Arge Andreasen's avatar Bjarki Arge Andreasen Committed by Daniel DeGrasse
Browse files

tests: spi: loopback: get spi controller before timed transfer



The test which measures and validates transfer times is using the
helper spi_loopback_transceive() to perform the transfer. This
helper internally gets the spi controller, which is useful for
most tests, but for this one, it means the time to get and put
the spi controller is included in the transfer time measurement.

This commit gets the spi controller before calling
spi_loopback_transceive() which results in only the actual
transfer time being measured.

Before this commit, on the nrf54h20:

  START - test_spi_complete_multiple_timed
  Transfer took 745 us vs theoretical minimum 108 us
  Latency measurement: 637 us
   PASS - test_spi_complete_multiple_timed in 0.008 seconds

  START - test_spi_complete_multiple_timed
  Transfer took 700 us vs theoretical minimum 54 us
  Latency measurement: 646 us

      Assertion failed at ...
  Very high latency
   FAIL - test_spi_complete_multiple_timed in 0.027 seconds

After this commit:

  START - test_spi_complete_multiple_timed
  Transfer took 250 us vs theoretical minimum 108 us
  Latency measurement: 142 us
   PASS - test_spi_complete_multiple_timed in 0.008 seconds

  START - test_spi_complete_multiple_timed
  Transfer took 204 us vs theoretical minimum 54 us
  Latency measurement: 150 us
   PASS - test_spi_complete_multiple_timed in 0.008 seconds

Signed-off-by: default avatarBjarki Arge Andreasen <bjarki.andreasen@nordicsemi.no>
parent 5163b8c9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment