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.

CCS/TMS320C6654: About DMA configuration of SPI to read/write from/to nor flash.

Part Number: TMS320C6654
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hi,

This issue is relative to

I actually implemented the initialization of dma part.

Then I noticed that both of SPIBUF & SPIDAT1 have 16 bit data register so copied user buffer is limited to 16bit(2byte).

From above e2e thread, that is mentioned as the follow.

>>But please make ACNT with a value like 64, 128, not 4. From your application, it is one time program and trigger, the actual transfer is split into multiple blocks, limited by the EDMA DBS and the data line width of SPI NOR.

Therefore I recognized that DBS value is 64 Byte so it can be set to acnt = 64 for optimization however the destination of copied buffer register has only 2 byte and spi nor flash data line width is also limited to the same.

In this case, Is there no problem to set acnt = 64? It seems that it is correct to set acnt =2, bcnt=framesize, ccnt=copysize /(acnt*bcnt) with A sync transfer.

My understanding wrong ?

regards,

  • Hi,

    In this case as the SPIBUF is only 16-bit, it is correct to set acnt =2, bcnt=framesize, ccnt=copysize /(acnt*bcnt) with A sync transfer.

    Regards, Eric 

  • M_N,

    The SPI driver that we provide as part of Processor SDK does support SPI DMA transfers but it is currently setup to use ACNT=1 so it does single transfer to SPIBUF.  If you are creating your own driver and are using CSL, I would recommend you take a look at the STK code that is shared on E2E here:

    https://e2echina.ti.com/question_answer/dsp_arm/c6000_multicore/f/53/p/47664/138147

    The package contains bunch of CSL based examples and bare-metal drivers including SPI DMA.

    Regards,

    Rahul

  • Hi lding,

    Thanks for your reply. I will implement as above at first.

    Hi Rahull,

    Thanks for your support.

    I don't use spi driver provided TI and already created my own however that doesn't have DMA function so need to implementation.

    I want to use EDMA3 LLD for DMA part at first.

    I can't read chinese. Is the "STK code" you mentioned attached as named as K1_STK_v1.zip on the top of the thread ?

    regards,

  • Hi,

    STK code is developed by engineers in TI China so many discussion is in Chinese. Yes, it is K1_STK_v1.zip. There is K1_STK_v1.1\SPI\src you can refer to if you prefer bare metal code. 

    If you want to use EDMA LLD, that is SYSBIOS implementation. In either approaches, you can look at how the EDMA parameter set is programmed, that doesn't rely on OS. Sorry it is misunderstanding that you can read Chinese. 

    Regards, Eric