SPIS communication frequency

Hi!

    Currently I have the following application requirements:

        Use SPI peripheral to communication with FPGA device. ( NRF5340 [ SLAVE ]  <--->  FPGA  [ MASTER ]  )

        The goal of the communication is 1000 data reads per second.( The size of each data read is 16bit * 18 = 288bit = 36Byte)

         PS:    1. I use a Zephyr (NCS) and SPI1(slave with Easy DMA).

                   2. The SPI frequency is set to 16000000.

        The solution I'm currently using is :

                1.SPI communication use [ k_poll_signal_reset, spi_transceive_signal ].

                2.The Timer timer is used for 1ms while the callback function is used [ k_poll_signal_check ], then print some debug message(not very longer), then continue to step 1 and return.

        But the problem I ran into was this - I observed through the debug information that the actual transfer rate was not 1ms at a time, but almost 3-4ms at a time.

        Do I need to change some configuration or code structure, or use other methods or even change some underlying code to reduce some code redundancy to improve code efficiency and communication frequency?

       Thanks!

Related