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.

TMS570LC4357: tms570lc4357

Part Number: TMS570LC4357

Tool/software:

I'm working on the TMS570LC4357, and I need to load my application into flash and execute it from RAM.

I want to achieve this using the linker script. How can this be done? 

I already know how to handle section-wise copying, but after my startup code executes, I need the execution to continue from RAM after entering main()

This is my application linker 

/* Linker Settings */

--retain="*(.intvecs)"

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

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

MEMORY
{
/* USER CODE BEGIN (2) */
/* USER CODE END */
VECTORS (X) : origin=0x00200000 length=0x00000020
//FLASH0 (RX) : origin=0x00000000 length=0x00200000
FLASH1 (RX) : origin=0x00200020 length=0x001FFFE00
STACKS (RW) : origin=0x08000000 length=0x00001500
RAM (RWX) : origin=0x08001500 length=0x00040000

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

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


/*----------------------------------------------------------------------------*/
/* Section Configuration */

SECTIONS
{
/* USER CODE BEGIN (5) */
/* USER CODE END */
.intvecs : {} > VECTORS
.text align(32) : {} > FLASH1
.const align(32) : {} > FLASH1
.cinit align(32) : {} > FLASH1
.pinit align(32) : {} > FLASH1
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM


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

Thanks

  • Hi Kusuma,

    Can you please download and refer the CAN bootloader example that i highlighted below:

    (+) [FAQ] TMS570LC4357: Examples and Demos available for Hercules Controllers (E.g. TMS570x, RM57x and RM46x etc) - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    And this example is also for TMS570LC4357, and here also we are copying FAPI library to the RAM. So, this might be useful for you.

    --
    Thanks & regards,
    Jagadish.

  • Yes, I am able to copy the Flash API to RAM and execute it. However, I also want to copy and run the .text section in RAM.

    I am facing an issue with the following error:

    Description Resource Path Location Type
    #10099-D program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. placement with alignment fails for section ".intvecs" size 0x20. Available memory ranges: HL_sys_link.cmd 

    However, my .text section size is small enough to fit into RAM.

    This is my linker

    MEMORY
    {
    /* USER CODE BEGIN (2) */
    /* USER CODE END */
    VECTORS (X) : origin=0x00200000 length=0x00000020
    // FLASH0 (RX) : origin=0x00000020 length=0x001FFFE0
    FLASH1 (RX) : origin=0x00200020 length=0x00200000
    STACKS (RW) : origin=0x08000000 length=0x00001500
    RAM (RW) : origin=0x08001500 length=0x0007EB00

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

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


    /*----------------------------------------------------------------------------*/
    /* Section Configuration */

    SECTIONS
    {
    /* USER CODE BEGIN (5) */
    /* USER CODE END */
    .intvecs : {} > VECTORS
    //.text align(32) : {} > FLASH1
    #if 1
    .text :
    {
    *(.text) /* All text (code) sections */
    *(.text.*) /* Any text subsections */
    } LOAD = FLASH1, RUN = RAM
    LOAD_START(TextLoadStart), LOAD_END(TextLoadEnd), LOAD_SIZE(TextSize),
    RUN_START(TextRunStart), RUN_END(TextRunEnd)
    #endif
    .const align(32) : {} > FLASH1
    .cinit align(32) : {} > FLASH1
    .pinit align(32) : {} > FLASH1
    .bss : {} > RAM
    .data : {} > RAM
    .sysmem : {} > RAM

    }

    Please help me on this 

    Thanks

  • Hi Kusuma,

    The reason for unlocking this thread is that it is not closed properly from TI side, so i unlocked it again.

    Apologies for the inconvenience.

    Are you still stuck with this issue, if yes then please let me know exactly where you stuck with this now.

    --
    Thanks & regards,
    Jagadish.