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.

[FAQ] Compiler/TI-RTOS-MCU: How can I control the placement of the "c_int00" program entry point with the TI Compiler?

Part Number: TI-RTOS-MCU

Tool/software: TI C/C++ Compiler

How can I control the placement of the "c_int00" program entry point with the TI Compiler for CortexM and C6x devices?

  • The following Program.sectMap entries in a .cfg file will align "c_int00" on a 0x800 byte boundary within the "SDRAM" memory segment for C6x targets:

    Program.sectMap[".c_int00 { boot.ae64P<boot.oe64P> (.text) }"] = new Program.SectionSpec();
    Program.sectMap[".c_int00 { boot.ae64P<boot.oe64P> (.text) }"].loadSegment = "SDRAM";
    Program.sectMap[".c_int00 { boot.ae64P<boot.oe64P> (.text) }"].loadAlign = 0x800;

    The above tells the linker to extract the .text section in boot.oe64P from the library file boot.ae64P and place it in a section called ".c_int00" and place that section in SDRAM aligned on a 0x800 byte boundary. Since there is only one function, "c_int00" in the boot.oe64P, this will align the function "c_int00" on a 0x800 byte boundary.

    The following Program.sectMap entries will precisely place the address of "c_int00" at location 0x80012000 for C6x targets:

    Program.sectMap[".c_int00 { boot.ae64P<boot.oe64P> (.text) }"] = new Program.SectionSpec();
    Program.sectMap[".c_int00 { boot.ae64P<boot.oe64P> (.text) }"].loadAddress = 0x80012000;

    Note:

    For various flavors of C6x targets, you'll need to modify the above file extensions accordingly (ie use .ae66 and .oe66 for the C66 ELF target). The same pattern follows for Arm targets. Examples for Arm targets will be given below. You may also need to modify the file extensions and provide them with a partial path relative to the project-specific linker library search path. For example, "ti/targets/arm/rtsarm/lib/boot.aem4f<boot.oem4f>" should be used in place of "boot.aem4f<boot.oem4f>".

    The following Program-sectMap entries will place "c_int00" somewhere in FLASH, aligned on a 0x800 byte boundary for Arm Cortex-M4F targets:

    Program.sectMap[".c_int00 { boot.aem4f<boot.oem4f> (.text) }"] = new Program.SectionSpec();
    Program.sectMap[".c_int00 { boot.aem4f<boot.oem4f> (.text) }"].loadSegment = "FLASH";
    Program.sectMap[".c_int00 { boot.aem4f<boot.oem4f> (.text) }"].loadAlign = 0x800;

    The following Program-sectMap entries will place "c_int00" at location 0x1000 for Arm Cortex-M4F targets:

    Program.sectMap[".c_int00 { boot.aem4f<boot.oem4f> (.text) }"] = new Program.SectionSpec();
    Program.sectMap[".c_int00 { boot.aem4f<boot.oem4f> (.text) }"].loadAddress = 0x1000;