This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AWR1642: How to increase the SPI throughput

Part Number: AWR1642
Other Parts Discussed in Thread: SYSBIOS

Hi,

I tested the SPI example on AWR1642 EVM, and got below loopback performace result, seems the maximum SPI throughput is only about 18.9Mbps, is the below test result right? Is it possible to increase the throughput, and how to?

Debug: Finished Digital loopback througput test, failed 0 out of 1000 times
Feature: SPI throughput at bitRate 1000 Kbps : 0.972797 Mbps: Passed
Debug: Finished Digital loopback througput test, failed 0 out of 1000 times
Feature: SPI throughput at bitRate 2000 Kbps : 1.894329 Mbps: Passed
Debug: Finished Digital loopback througput test, failed 0 out of 1000 times
Feature: SPI throughput at bitRate 6000 Kbps : 5.184139 Mbps: Passed
Debug: Finished Digital loopback througput test, failed 0 out of 1000 times
Feature: SPI throughput at bitRate 10000 Kbps : 7.821354 Mbps: Passed
Debug: Finished Digital loopback througput test, failed 0 out of 1000 times
Feature: SPI throughput at bitRate 20000 Kbps : 12.849263 Mbps: Passed
Debug: Finished Digital loopback througput test, failed 0 out of 1000 times
Feature: SPI throughput at bitRate 40000 Kbps : 18.917902 Mbps: Passed

I tried to change the below macro from 64 to 128, but the test failed with ISR stack overflow error. 

/*!
* @brief Maximum element in MibSPI RAM.
* For 8bit data size, the maximum transfer size is 64 bytes
* For 16bit data size, the maximum transfer size is 128 bytes
*/
#define MIBSPI_RAM_MAX_ELEM 64U

Then I increased the stack size with below added in the mss_spi_linker.cmd, the above error didn't appear, but with a new below error report, I tried to increase the task stack size but it could not be solved.

-stack 0x4000

Debug: SPI Instance @08012208 has been reopened in master mode successfully
Exception occurred in ThreadType_Task.
Task handle: 0x8011fe8.
Task stack base: 0x8010800.
Task stack size: 0x800.
R0 = 0x0000f9a0 R8 = 0xffffffff
R1 = 0xfffffdec R9 = 0x08012120
R2 = 0x00011b60 R10 = 0x00000002
R3 = 0x00000001 R11 = 0xffffffff
R4 = 0xf0efeeed R12 = 0x00000004
R5 = 0xfffffdec SP(R13) = 0x0800dfa0
R6 = 0x0001426a LR(R14) = 0x08011ad0
R7 = 0x0801222c PC(R15) = 0x00007714
PSR = 0x200c019f
DFSR = 0x00000801 IFSR = 0x00000000
DFAR = 0xf0efef01 IFAR = 0x00000000
ti.sysbios.family.arm.exc.Exception: line 205: E_dataAbort: pc = 0x00007714, lr = 0x08011ad0.
xdc.runtime.Error.raise: terminating execution

Whatever the above error, my question is to increase the SPI throughput, your free comments is welcome. Thank u very much.

Andy

  • Hello Andy,
    Could you please help us with more details on the SPI test? was it from the SDK? Are you using the CPU mode or the DMA mode ?
    regards
    Abdul
  • Abdul,
    I used the test code in mmwave_sdk_01_00_00_05\packages\ti\drivers\spi\test\xwr16xx on AR1642 EVM, and not did any changes. The above test is based on DMA mode. I think u can reproduce the issue at your side to check the SPI throughput test.
    BR,
    Andy
  • Abdul,

    In the errata SWRZ072, it says the SPI speed can be up to 33MHz, but we tested the SPI throughput is about 18MHz shown in the above post using the SPI example in sdk 1.0 on AWR1642 EVM. Would u pls instruct me how do u test to reach 33MHZ, and share me the test project if have? Thank u very much.
    Andy

  • The SPI clock speed is 40MHz for  the SPI test . The 18Mbps is the realistic throughput one would get when they actually do this via software. The actual bits are getting transmitted at 40Mhz but if you count the time from when the user submits the buffer to driver and gets the buffer back, there will be overhead to setup the DMA, program the SPI H/W to do the transfer, etc. 

    From software point of view, advertising that each bit went out at 40MHz doesn’t give any value – its what the actual time that it will take the application to practically send the buffer across is what would help to accurately design the system

    I hope this clarifies.

    regards

    AK