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 Boot loader?

Other Parts Discussed in Thread: TMS570LC4357, HALCOGEN

There doesn't seem to be a specific boot loader app/example for the TMS570LC4357 although I did see the TMS570 Hercules boot loader page.  I noticed that in the example for the LS04x (which I was thinking about porting since it seems to have the same flash) the flash API is copied into RAM.  It's not clear how the API calls are linked when the functions are moved.  I also played with executing a "blinky" in the LC4357's RAM (using internal SRAM, not external EMIF) as a precursor to trying to run bootloader code in RAM and was unsuccessful.  So.  To summarize, I have 2 questions -

1.  Are there any plans to provide a LC4357 boot loader example and if so, when?

2.  Is it possible to execute code in internal SRAM in the LC4357?  If so, could I get a simple example?

Thanks, Dan

  • FYI, my failed attempt at RAM execution was based on the HALCoGen "example_emif_sdram" project, ignoring the emif setup and using the following modified linker command info.  Note I did verify the Blinky function was copied correctly into RAM.  It just seemed to fail when stepping into it.  Is there anything special that needs to happen to initialize RAM to execute code?

    /*----------------------------------------------------------------------------*/
    /* sys_link.cmd */
    /* */
    /* (c) Texas Instruments 2009-2013, All rights reserved. */
    /* */
    /*----------------------------------------------------------------------------*/
    /* USER CODE BEGIN (0) */
    /* USER CODE END */


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

    --retain="*(.intvecs)"

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

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

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

    /* USER CODE BEGIN (3) */
    /* no worky: SDRAM (RWX) : origin=0x08060000 length=0000020000 */
    SDRAM (RW) : origin=0x08002000 length=0000001000
    /* USER CODE END */
    }

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


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

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

    /* USER CODE BEGIN (6) */
    .blinky_section : RUN = SDRAM, LOAD = FLASH0 | FLASH1
    LOAD_START(BlinkyLoadStart), LOAD_END(BlinkyLoadEnd), LOAD_SIZE(BlinkySize),
    RUN_START(BlinkyStartAddr ), RUN_END(BlinkyEndAddr )
    /* USER CODE END */
    }

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


    /*----------------------------------------------------------------------------*/
    /* Misc */

    /* USER CODE BEGIN (8) */
    /* USER CODE END */
    /*----------------------------------------------------------------------------*/

  • Was able to execute above from RAM when setting the MPU RAM region correctly (PRIV_RW_USER_RW_EXEC).

    Still interested whether TI is going to port a bootloader example for the TMS570LC4357.
  • Dan,

    Let me answer few of your questions that I can right now,

    a. It's not clear how the API calls are linked when the functions are moved

    When the code is compiled, there are few linker options to say where they will get loaded, but on run-time they might be running, that's from a different location and the linking happens accordingly, here is the snippet from your example which is responsible for this,

    .blinky_section : RUN = SDRAM, LOAD = FLASH0 | FLASH1
    LOAD_START(BlinkyLoadStart), LOAD_END(BlinkyLoadEnd), LOAD_SIZE(BlinkySize),
    RUN_START(BlinkyStartAddr ), RUN_END(BlinkyEndAddr )


    b. Can we execute code from SRAM ?

    Yes. You can keep the reset vector in Flash and move specific sections using the above linking method run code from SRAM
    or
    If you can afford to run the test code with debugger connected, then you can map both Program, Data, stacks etc on to SRAM with alternate memory map using MEMSW(Memory Swap) from System Module (TRM section 2.5.1.40 contains more details on how to). In this mode SRAM and FLASH interchange memory map's.

    Regarding the Boot loader example for LC4357, I will check with our software team and get back to you.