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.

ramfunc code size issue while running stand alone mode

Other Parts Discussed in Thread: CONTROLSUITE

I am using the Piccolo F28069 and trying to do the usual loading of code to RAM using ramfunc. I ran into an issue when trying to run without the emulator (stand alone mode).

Everything works fine until the code size in RAM exceeds a certain limit, in this case it is 0x03d8. Then it would not run in stand alone mode (still can run with an emulator though). I tried to comment out a few lines of code that are supposed to be in RAM and it was back to working again (stand alone). I've looked at the map file and nothing looked out of the ordinary. All the intended functions are located in RAM as they are supposed to, and there is still plenty of memory available after all the ramfunc code. I've never seen this before and wonder if anyone has a clue. Probably something simple that I overlooked.

Thanks,

Erik

  • Hi Erik!

    Erik Dinh said:

    I am using the Piccolo F28069 and trying to do the usual loading of code to RAM using ramfunc. I ran into an issue when trying to run without the emulator (stand alone mode).

    At first. Do you mean that you don't use loading to flash (only to RAM)? In fact at this case the firmware will not start in standalone mode of DSP.

    Regards,

    Igor 

  • Hi Igor,

    I used the FLASH cmd file if that was what you meant. If you read further you'd see that my code runs standalone until I exceed about 1k of code in RAM.

    This is one line of code in the map file that shows the status of the RAM code

                                    origin           length         used         unused

      PRAML0                00008000   00000800  000003c9  00000437  RWIX     <- not working standalone

    When I comment out one line of code that is supposed to be in RAM this looks like

      PRAML0                00008000   00000800  000003b8  00000448  RWIX     <- back to working standalone

    (Notice the difference in "used" memory).

    Any idea would be appreciated.

    Erik

     

  • Hi Erik!

    Erik Dinh said:

    When I comment out one line of code that is supposed to be in RAM this looks like

      PRAML0                00008000   00000800  000003b8  00000448  RWIX     <- back to working standalone

    Does it refer to a some particular line or to any one line?

    Also I would recommend you the following:

    5773.TI_Running_from_Flash_spra958l.pdf

    3808.TI_Copying Compiler Sections From Flash to RAM.pdf

    http://processors.wiki.ti.com/index.php/C28x_Compiler_-_Understanding_Linking

    Regards,

    Igor

  • Erik,

    I once faced a similar issue upon flashing,which was that  i was able to flash my program to DSP successfully until my code size of program was too large to fit into internal ram ,  the solution was to move those unfit-able sections to external RAM, although I am not sure if you are facing same issues, just for your reference.  


    Regards,

    Zachary

  • Igor,

    No, it doesn't matter what line of RAM code I comment out, as long as it brings the "used" memory down a bit, and it is back to working stand alone. This is very strange to me.

    Zachary,

    I have no problem with space. If you look at the line on my map file above, you'll see that I still have "unused" space left.

    Btw, I am using the F28069 Control Card.

    Again, any help would be appreciated.

    Erik

  • Hi Erik!

    Could you please upload your CMD file at first (or better project.zip)? BTW did you go through my above references?

    Regards,

    Igor

  • Here is the CMD file. And yes I am familiar with the documents you referenced.

     

     

  • Here is the CMD file. And yes I am familiar with the documents you referenced.

  • Thanks Erik. I will look...

    Regards,

    Igor

  • Hi Erik!

    At first try this 

    3348.F28069_FLASH_0.txt
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    /*
    //###########################################################################
    //
    // FILE: F28069_FLASH.CMD
    //
    // TITLE: Linker Command File For F28069 Device Flash API
    //
    //###########################################################################
    // $TI Release: F2806x Flash API Release V1.00 $
    // $Release Date: March 31, 2011 $
    //###########################################################################
    */
    /* ======================================================
    // For Code Composer Studio V2.2 and later
    // ---------------------------------------
    // In addition to this memory linker command file,
    // add the header linker command file directly to the project.
    // The header linker command file is required to link the
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Regards,

    Igor

  • Thanks Igor, but it is not working. I think I had already tried this.

  • Hi Erik!

    Honestly I didn't find something wrong in your CMD so far. Just I have tried to go empiric way. What kind of emulator do you apply?

    Regards,

    Igor

  • I use CCS 5.4. I've tried on 2 different control cards and they both showed the same symptom. I've also tried different RAM blocks but it didn't help either. Just a reminder I can run code with the emulator. Only when I try running on its own then I'd have this issue.

    For now as a temporary fix I am running most code from FLASH, but I'd like to find the solution so I can get back some processing time (by running some code in RAM).

    Thanks again,

  • Well...Just in case I would try to test this issue. One might take some simple example (for example Blinky from controlSUITE) and define array:

    #pragma DATA_SECTION( array,"section name")

    Uint16 array[N];

    One might try N up to 2048 (0x800) and check when the project will behave like your project (if of course it's going to happen ...). Maybe the some problem with the code is somehow linked to its size in memory...Of course it sounds absurd.

    Regards,

    Igor

     

  • Hi Erik!

    There are a couple of suggestions also.

    1 Reinstalling CCSv5.4

    2 To try CCSv5.2

    Regards,

    Igor

  • Hi Igor,

    Your first suggestion: I am not sure about creating the data array because I have problem with the program space, not data space. However, I can create some fake code to put in RAM instead and see how it goes.

    About the second suggestion: I am a bit confused about your wording. Can you clarify that I need to "Uninstall 5.4" and install 5.2? If so, are you sure 5.2 will resolve it? It is a major undertaking with high risk of messing up other things and I don't feel like I have time to experiment with this if the outcome is not certain.

    Thanks,

    Erik

  • Hi Erik!

    1) Yes, I understand that there is issue of program memory (not data memory), but I would try anyway. In my opinion this will help to locate the reason issue.

    2) I mean to uninstall CCSv5.4 and install it again. If this step will not help then to try to go on CCSv5.2. (If you pay attention on threads of CCS forum you will see that some problems with v5.4 occur sometimes).

    Regards,

    Igor 

  • Just an update,

    After having tried various paths to fix the issue, I took a look at the actual MemCopy function (given by one of the examples in controlSuite) and replaced it with the memcpy function. It works! I don't have time at the moment to find out the reason but the bottom line is:

    Do not use this!

     

    void Example_MemCopy(Uint16 *SourceAddr, Uint16* SourceEndAddr, Uint16* DestAddr)

    {

         while(SourceAddr < SourceEndAddr)

        {

           *DestAddr++ = *SourceAddr++;

        }

         return;

    }

    Use this

        memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

     

    Thanks for all the feedback;

    Erik