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.

AM3352: Starterware memcpy is slow

Expert 1385 points
Other Parts Discussed in Thread: AM3352

Dears:

I follow the RTOS-SDK startware to test am3352.

I run a app that do memcpy,

for(i = 0 ; i< 10000; i++){
        memcpy(addr, addr+2048, 1024);
    }

finally, I found it taken 3 sencond, it's too slowly.

And I Print the CPU's frequency as below :

CM_CLKSEL_DPLL_MPU :0x3e817     M= 1000  N = 23
CM_DIV_M2_DPLL_MPU :0x201          M2 = 1
CM_CLKMODE_DPLL_MPU :0x7

and MPU dpll  clock is 1000MHz = 1GHz.

and why the speed is so slowly,  I run same code in linux, it takes 30ms .

Thank you very much !

Best Regards

Qing

  • Hi,
    You query has been assigned to a TI engineer. Please note that response may be delayed due to Christmas and New Year holidays.
  • Hi Qing,

    It is strange. memory copy of 1MB (1000*1KB) should not take 3s. One possible reasons may be the DDR configuration (are you using GEL file or your won code to do the DDR configuration?) or the memory copy is out of the DDR range (0x80000000 - 0xBFFFFFFF).

    Can you try the same experiment with OCMC (0x40300000 - 0x4030FFFF, 64KB) or SRAM internal (0x402F0000 - 402FFFFF, 64KB)?

    Ming

  • Dear Ming:

    This code is that run in  OCMC (0x40300000 - 0x4030FFFF, 64KB). I just only  add

    for(i = 0 ; i< 10000; i++){
            memcpy(addr, addr+2048, 1024);
        }

    and printf into the MMCSD boot loader code. and rebuilt it , run code in my am3352 platform.

    But , the bootloader loaded the  app, and app is running, memcpy is quickly!

    If we don't  set the PLL and DDR in uboot , and use rom code 's default mpu clock to run memcpy,

    It's also quickly.

    But, in SBL, we use use rom code 's default mpu clock to run memcpy,

    It's also very slowly!

    Best Regards

    Qing

    Best Regards

    Qing

  • Hi Qing,

    What is the value of "addr"? can you change it from DDR to SRAM?

    Ming

  • Hi Qing,

    Are there any differences between the Linux and SBL for the MPU PLL setting registers?

    Ming

  • This is char addr[4096]

  • When enter a main function  ,  the memcpy is done , It's so slowly,  but uboot is quickly.  pll have not been set.

    I doubt that it's the startcode's issue , and I follow uboot to write a startcode , and the test is still slowly.

    It's quite strange !

    I think you can see same result in your am3352 evm board!

    Sorry, Merry Christmas!!!

    Best Regards

    Qing

  • Hi Qing,

    When you mentioned the startcode, do you mean the sbl code? And the main() you mentioned is the main of your application code (app), right?

    I also think the problem is in sbl which sets the PLL and pin mux for the board. Here I think the issue is the DDR settings.

    When you declare char addr[4096] as a global array, it will be allocate in .bss section. It should be listed in MAP file. If you declare it in a function (local array), it will be allocated in the stack. Can you do the same experiment with addr[4096] in DDR and OCMC respectively. If the OCMC test is fast and the DDR test is slow, then we know it is the DDR settings.

    Ming