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.

The problem occur when we load data file into ddr

Hi TI engineer

      In our application we need to load a data file which is more than 1MB into ddr in the program. Ddr has been initialized in the gel before that. We try two ways to accomplish it,but both of them has failed.The problem is described as follows:

      1. we use #include like that:

          #pragma DATA_SECTION( a, ".DDR");

         float  a[16384] = {#include    "..../..../....bin"   }

         we define a ,b and c.But then we find that only a is on ddr, b and c is mapped into L2 SRAM. But if we don't set value for a,b and c, then they will be map to DDR.

       2.then we try another way by using fopen and fread like this:

        fp = fopen( "..../..../....bin" ) ;

        fread(a , 4, 16384, fp);

        But then we find that we can only read 128 Byte into ddr, no more data can be read after then.

        Can you tell us how did these problems happen?How can we load data into DDR? Of course we don't want to load memory manully every time.Thank you very much

  • Yuchao,

    Your questions are not about a multi-core device hardware or function of the device, so this Keystone Multicore Forum is not the right place for these questions. I will ask a Moderator to move this thread to the TI Compiler Forum where these questions can be more appropriately addressed.

    In that new location, it will help if you are clear to them about the TI DSP device you are using and the version of the compiler and CCS that you are using. They will likely need a small test case project that you can demonstrate this behavior - please create the test case project, verify it fails as expected, then export it to a zip file and attach the zip file to your clarifying post.

    1. From only what you have listed here, it is not obvious that you have done the DATA_SECTION correctly or that the #include syntax is correct. By the way, I have never seen anyone use #include the way you have used it here. That is clever, assuming it does not contribute to this problem.

    2. Have you checked if the fread function has a limit on the arguments? Have you tried setting the fopen type to "rb" for 'read'+'binary'?

    You might also try reducing the number of floats read per call to fread and use a loop to read in all the values.

    Regards,
    RandyP

  • Hi Randy

           Thank you very much.But I didn't find any forum called "TI Compiler".Will their response sended to me directly?

  • A Moderator already moved this thread to the correct forum.

    Please get a test case ready if you want to speed the process. They might not need it, but if they do, it will help to have it available.

    Regards,
    RandyP

  • What ISA are you using?  What are your exact command-line options?

    Can you make array "a" const?

    We'll need more of a test case.  Show us the definition of b and c.  Show us your linker command file.