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.

RM57L843: Force RUN_START value to a MEMORY section

Part Number: RM57L843

Tool/software:

Hi,

I am trying to load flash api's onto the RAM using the following Linker script command. However I would like to this to be loaded into a specific memorysection of RAM defined under MEMORY in linker script. Could anyone tell me how I can specify that?

MEMORY

{

.flashAPI (RWX)  : origin=0x0806F000 length=(0x00001000)

}

flashAPI:
{
.\Boot\Fapi_UserDefinedFunctions.obj (.text)
.\Boot\bl_flash.obj (.text, .data)
--library= "c:\ti\Hercules\F021 Flash API\02.01.01\F021_API_CortexR4_LE_L2FMC.lib" (.text, .data)
} palign=8 load = FLASH0 |FLASH1, run = RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)

Here I would like the linker script to generate apiRunStart and other flash addresses that lie within flashAPI memory section defined above.

Thanks,

Ravi

  • Hi Ravi,

    Apologies for the delay in the late response, i was stuck with other issues in this mean time.

    You can try something as below:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    MEMORY
    {
    FAPI_RAM (RW) : origin=0x0806F000 length=(0x00001000)
    }
    flashAPI:
    {
    .\Boot\Fapi_UserDefinedFunctions.obj (.text)
    .\Boot\bl_flash.obj (.text, .data)
    --library= "c:\ti\Hercules\F021 Flash API\02.01.01\F021_API_CortexR4_LE_L2FMC.lib" (.text, .data)
    } palign=8 load = FLASH0 |FLASH1, run = FAPI_RAM, LOAD_START(apiLoadStart), RUN_START(apiRunStart), SIZE(apiLoadSize)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Once you did this, then apiRunStart will map to the address in the FAPI_RAM section (which is our required section).

    So, in the main loop if you call the below function then our code in the flash will get moved to the required section in the RAM.

    memcpy(&apiRunStart, &apiLoadStart, (uint32)&apiLoadSize);

    --
    Thanks & regards,
    Jagadish.