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.

How to make DDR2 into .cmd file?

Other Parts Discussed in Thread: CCSTUDIO

Hi to everyone!

I want to use DDR2 SDRAM in DSK6455. I've read the DDR2 example in the folder of ...\default_package\csl_c6455\example. In the example, there is a pointer to point to DDR2 space. And it works on the board.

But I want allocate some section in the DDR2, could I creat a new .cmd file like below? 

******************************************************************************************
-c
-heap  0x2000
-stack 0x2000
/* Memory Map 1 - the default */
MEMORY
{
        L1D:     o = 00f00000h   l = 00008000h 
        L1P:     o = 00e00000h   l = 0000F000h 
        L2:      o = 00800000h   l = 00200000h
        EXT_MEM: o = E0000000h   l = 07A12000h 
SECTIONS
{
    .csl_vect   >       L2
    .text       >       L2
    .stack      >       L2
    .bss        >       L2
    .cinit      >       L2
    .cio        >       L2
    .const      >       L2
    .data       >       L2
    .switch     >       L2
    .sysmem     >       L2
    .far        >       L2
    .testMem    >       L2
    .MY_DATAMEM >       EXT_MEM
       
}
*******************************************************************************
But when compling, there are 4 errors:
*********************************************************************************
<Linking>
        EXT_MEM: o = E0000000h
>> D:\\CCStudio_v3.3\\MyProjects\\DDR2_test\\link.cmd, line 45:   error: 
               syntax error
>> D:\\CCStudio_v3.3\\MyProjects\\DDR2_test\\link.cmd, line 45:   error: 
               MEMORY specification ignored
>> D:\\CCStudio_v3.3\\MyProjects\\DDR2_test\\link.cmd, line 46:   error: 
               origin missing for MEMORY region 'E0000000h'
>> Compilation failure
Build Complete,
  4 Errors, 1 Warnings, 0 Remarks.
************************************************************************************
I hope for your suggestion!
Thanks!
  • The proper syntax for a hex number using the "h" suffix requires that the first digit be numeric. Insert a zero "0" in front of the E0000000h and it will work better.

    It is most common to set the length parameter to the actual size of the memory that is available. There are exceptions, of course.

  • Thanks a lot! It works well!

    I have anothor question. If I want the data transfer from outside (eg. FPGA) to DDR2 SDRAM, could I do this throgh EMIFA + EDMA ?

    Just like this,

    ....
         myParamSetup.srcAddr = 0xC0000000                             // source address - CE4 space 
         myParamSetup.aCntbCnt = CSL_EDMA3_CNT_MAKE(1024,1);                   // Acnt Bcnt 
         myParamSetup.dstAddr = 0xE0000000;                            // destination address - DDR2 space

    ...

    I hope for your advice.Thanks.

  • Yes, you can do this.

    The EDMA can transfer from any slave memory or peripheral to any slave memory or peripheral. You must be mindful of the SCR Connection Matrix for your device when choosing which Queue/Transfer Controller to use, but that will not limit you for the EMIFA-to-DDR2 transfer.

  • Thank you.

    I've done an experiment on DSK6455. and it works well!