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.

TMS570LC4357: SPI to SRAM via DMA, timing question

Part Number: TMS570LC4357


Team,

A customer has a question about servicing the SPI via DAM, copy data to SRAM:

...

The goal is to find out if DMA can transfer the data from the SPI modules to the SRAM quickly enough.

The processor operates at the following frequencies:

• GCLK 240MHz
• HCLK 120MHz
• VCLK 60MHz
• SPICLK 25MHz

The SPI is operated in slave mode at 25MHz, the MibSPI modules 1 to 4 are used in continuous mode, up to 1500 bytes per SPI and direction are transmitted. All data should be transferred in 500us.

That is, each SPI should have a DMA channel in receive and a DMA channel in the transmit direction.
The first DMA transfer is initiated by the software, after which the further transfers are to be started by channel chaining.

--> How can DMA transfer be configured here so that the data transfer between SPI Buffer and SRAM takes place as quickly as possible?
--> And how many clock cycles are needed for a data transfer?
--> Which clock does the DMA run with?

The following is our assumption for the sequence of a DMA transfer with a suspected number of clock cycles per step.

--> Are these assumptions correct? Or can you complete/improve the flow and timing information?
--> Are further parallelizations/optimizations possible?

 • 1. DMA request by software

 O DMA channels 0 and 1 read their primary control Package 6 cycles
 O channel 0 and 1 write data to the working Images 3 cycles
 O Arbitration may be necessary 1 cycle
 O Wait States may be required ??? Cycles
 O channel 0 and 1 perform DMA transfers Number of cycles = (Reads + Writes per element) X Number of elements in the block

 • 2. DMA request for channels 2 and 3

 • …

 • For the next transfers for channels 0 and 1 Skip the step 'Share into working images'

  --> Is a clock cycle required for a read or write operation (in the element)?

...

Thanks & best regards,
  Robert

  • Hi Robert,

    We don't have the cycle information for DMA accesses like those mentioned in your post. I will have to check if we have a bandwidth measurement that I can provide.

    Regards, Sunil

  • Hello Mr. Oak,

    as the TMS570 shall be used in a safety critical application, we need a proved worst-case value for the DMA speed under the described conditions. A measurement might not be sufficient for that.

    Can you please also answer the other questions?

    Kind regards,

    Katja Zimmermann

  • Hi Katja,

    See my comments below in blue.

    --> How can DMA transfer be configured here so that the data transfer between SPI Buffer and SRAM takes place as quickly as possible?

    >> The received data is 16-bit wide in each of the buffers (with 16 additional bits of status). So each individual reads from the MibSPIRX buffer would be 16 bits. The data bus width for writing to the shared SRAM is 64 bits, so you can configure the write element size to be 64 bits.

    The DMA support packing/unpacking the data when the read-element-size and write-element-size are not the same. In this case, it will read 4x 16-bit values from the MibSPI RX buffer before making a 64-bit write to the shared RAM. This minimizes the number of accesses the DMA has to make on the interconnect. Please refer to the reference manual for more details on the packing / unpacking operation of the DMA.

    --> And how many clock cycles are needed for a data transfer?

    >> This depends on several aspects, including clock configuration, number of DMA channels active, any arbitration requirements between the CPU and DMA accesses (if any).

    --> Which clock does the DMA run with?

    >> The DMA controller uses the HCLK for its operation.

    --> Are these assumptions correct? Or can you complete/improve the flow and timing information?

    >> DMA channels 0 and 1 do not work in parallel, since both the source and destination addresses for the two channels are from the same inteconnect slave targets. All MibSPIx RAMs are accessed via the PCR3 (Peripheral Central Resource 3). These will have to be completed sequentially.

    --> Are further parallelizations/optimizations possible?

    >> How do you synchronize the DMA transfers with the MibSPIx communication statuses? When does the software trigger the first DMA channel? Are all MibSPIx modules slaves to the same master?

    We can have an offline conversation so that I can better understand the requirements. I will ask Robert to facilitate this.

    Regards,

    Sunil

  • Hi Sunil,

    Thank you very much for your answer! We will appreciate to have an offline conversation next week so that we can tackle our issue.

    Best regards

    Mathieu 

  • Discussion continued offline. Closing this thread.