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.

EDMA3 Intermediate chaining (for breaking up large transfers)

Hi,

My setup :

C6678 EVM, CCS 5.1.1.00031, Compiler v3.3, mcsdk_2_00_05_17, pdk_C6678_1_0_0_17, edma3_lld_02_11_03_02

Background :

I've been playing around EDMA3 for a few days now.

I've successfully tested the edma_test.c examples that comes with the CSL.

I've also tested several simple cases that worked well such as : simple block transfer using global regions, simple block transfer using shadow regions, chained block transfer with shadow regions, 2D block transfer.

My problem :

I'm now trying to do the 'Breaking Up Large Transfers with Intermediate Chaining' of p99/173 of the EDMA3 controller guide

I want to transfer 10240 short elements (2bytes) as 10*1024 transfers. These elements are in external memory and will be transfered to L2 memory

Right now, only the first transfer of 1024 elements works, the self-chaining doesn't work

I use the instance 1, channel 1, shadow region 5

myParamSetup is as follows :

    myParamSetup.option = CSL_EDMA3_OPT_MAKE( CSL_EDMA3_ITCCH_EN, \
CSL_EDMA3_TCCH_DIS, \
CSL_EDMA3_ITCINT_DIS, \
CSL_EDMA3_TCINT_EN, \
channelNum, \
CSL_EDMA3_TCC_NORMAL, \
CSL_EDMA3_FIFOWIDTH_NONE, \
CSL_EDMA3_STATIC_DIS, \
CSL_EDMA3_SYNC_A, \
CSL_EDMA3_ADDRMODE_INCR, \
CSL_EDMA3_ADDRMODE_INCR
);
Additionnal info : channelNum = 1, ITCCH_EN because I want the self chaining,
TCCH_DIS because it's a one time transfer, TCINT_EN
because at the end of the 10 transfers I want to poll regionIntr.intr & (1<<channelNum) to know when it's finished.
    myParamSetup.srcAddr    = (Uint32)block_src;
myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(ACNT,BCNT);
myParamSetup.dstAddr = (Uint32)block_dst + L2Offset; // global adress
myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(SRCBIDX,DSTBIDX); // 0,0 in this case
myParamSetup.linkBcntrld= CSL_EDMA3_LINKBCNTRLD_MAKE(CSL_EDMA3_LINK_NULL,0);
myParamSetup.srcDstCidx = CSL_EDMA3_CIDX_MAKE(0,0);
myParamSetup.cCnt = CCNT;
with
        #define TYPE_BYTE_SIZE 2      //using 'short'
	#define NB_ELEMENTS_PER_TRANSFER 1024
#define NB_TRANSFERS 10

#define ACNT (NB_ELEMENTS_PER_TRANSFER*TYPE_BYTE_SIZE)
#define BCNT NB_TRANSFERS
#define CCNT 1
#define SRCBIDX 0 // default
#define DSTBIDX 0
and 
	coreNum = 0;
L2Offset = 0x10000000 + coreNum*0x01000000;

I also have in my cmd file

    .block_src_DATA	: > 0x80000000     // source in external memory
.block_dst_DATA : > 0x00800000 // destination in L2 memory
with block_src and block_dst of 10240 size.
It is supposed to work like this :
"Upon completion of the first array, intermediate transfer complete code chaining 
generates a synchronization event to channel 1, a value specified by the TCC field.
This intermediate transfer completion
chaining event causes EDMA3 channel 1 to transfer the next array"
but it seems like it doesn't decrement BCNT and only do it once. It doesn't self-chain.
Can you explain to me what I'm doing wrong ?
I can provide the files if needed.
Thank you,
CM
  • Hi CM,

    Although you are using A-sync but if the BCNT>1, the SRC and DST address in EDMA will be updated by SRCBIDX and DSTBIDX for each chaining. 

    So instead of using 0 as 

    myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(SRCBIDX,DSTBIDX); // 0,0 in this case

    you should set SRCBIDX=DSTBIDX=ACNT in your OPT, and you will see all the 10 transfers are chained

    myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(ACNT,ACNT);

    Please refer to Table 2-5 in EDMA3 user's guide for details as well.

    Sincerely,

    Steven

  • Thank you Steven,

    It worked like a charm with myParamSetup.srcDstBidx = CSL_EDMA3_BIDX_MAKE(ACNT,ACNT);

    I hadn't paid much attention to the table 2-5, thanks it will be useful.

    I have another (small) question. When I use the board for the first time in the day I do the following

    Build All, launch target configuration (with the c6678 gel file), connect target, load program and resume.

    With the EDMA I've noticed that the transfer doesn't work the first time : the program runs fine but no data is copied. (I check with the memory browser)

    Then I do system reset and when I re-run the same program it works fine.

    Am I missing an initialisation step ?

  • You may need to run the "Global_Default_Setup" in the GEL file before loading the program and after connecting to the target.

    Please take a look at the following page about the initialization steps.

    http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_Getting_Started_Guide

    Hope it helps.

    Sincerely,

    Steven

  • When I run the Global_Default_Setup it works now.

    Thanks. As you can see I'm not very familiar with the use of Gel files and their purpose. I know understand better why they are useful.