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.

Download and run the program from RAM without erasing the existing program

Hello Support Team,

We are using TMS570LS20216A for our development and the memory allocated for our application is from 0x00000000 to 0x00003FFF.

For debugging of our system  we want to use one more application which shall be downloadable to RAM and run from RAM  without erasing the existing application which is residing in flash.

We do not want to use bootloader concepts or flash memory partition for this approach.

As we are using Code composer studio for our development, Please let us know the steps to download and run the code from RAM without disturbing my old application.

Thanks and Regards,

Veeru

 

  • Veeru,

    Your application running from RAM has to be linked to map the internal RAM and not the flash.

    Here is an example:

    //*----------------------------------------------------------------------------*/
    /* sys_link.cmd                                                               */
    /*                                                                            */
    /* (c) Texas Instruments 2009-2010, All rights reserved.                      */
    /*                                                                            */


    /* USER CODE BEGIN (0) */
    /* USER CODE END */


    /*----------------------------------------------------------------------------*/
    /* Linker Settings                                                            */

    --retain="*(.intvecs)"

    /* USER CODE BEGIN (1) */
    /* USER CODE END */

    /*----------------------------------------------------------------------------*/
    /* Memory Map                                                                 */

    MEMORY
    {
        VECTORS (RX) : origin=0x08000000 length=0x00000100
        STACKS  (RW) : origin=0x08000100 length=0x00001500
        RAM1    (RW) : origin=0x08001600 length=0x00018000
        RAM2    (RX) : origin=0x08019600 length=0x00018000



    /* USER CODE BEGIN (1) */
    /* USER CODE END */
    }

    SECTIONS
    {
        .intvecs : {} > VECTORS
        .text    : {} > RAM2
        .const   : {} > RAM2
        .cinit   : {} > RAM2
        .pinit   : {} > RAM2
        .bss     : {} > RAM1
        .data    : {} > RAM1

    /* USER CODE BEGIN (2) */
        .sysmem : {} > RAM1
    /* USER CODE END */
    }


    /*----------------------------------------------------------------------------*/

    When you download this application using CCS (Run->Load->Load Program) CCS will not erase the content of the Flash.

    Note: You have to be sure that in your application linker command file, there is no section assigned to flash.
    If a section is assigned to flash, CCS loader will first erase this section.

  • Hi,

    We have implemented the above code in my "sys_link.cmd" file and able to compile. 

    We have written the code to blink an LED connected on NHET pin 1 (I am using TMS570LS20216SPGE USB development kit) and trying to run the code debugging mode, but we facing the following issues:

    1. We are getting the following statement "CortexR4: Trouble Removing Breakpoint with the Action "Finish Auto Run" at 0x8019c2c: (Error -1066 @ 0x8019C2C) Unable to set requested breakpoint in memory. Verify that the breakpoint address is in writable memory. (Release 5.0.429.0) ".

    2. We are unable to put the break points in the code.  

    Code writted for testing:

        while(1)
          {
                NHET_SetPinDir(1,OUT);
                     
                NHET_SetPin(1);
                for(i=0;i<0x000FFFFF;i++)
                {
                }
                NHET_ClearPin(1);
                for(i=0;i<0x000FFFFF;i++)
                {
                }
          } .

     

    Please let me know how to execute my LED blink program from RAM area.

     

    Thanks in advance,

    Ajay.

     

  • Ajay,

    What is the status on your post? Did I answered your question?

    If so, can you mark it as "Verified Answer" so I can close this thread?

  • Hi Marc,

    Yes, I got the solution from you and I the problem is I am not seeing GREEN BUTTON "VERIFIED ANSWER" in the bottom. Even I am unable to close the other threads because of this this and pleas let me know what can I do.

    Thanks & Regards,

    Ajay.

     

  • hi,

        I met the same problem, can u tell me how did u solve that problem?