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.

platform independent custom memory map

Other Parts Discussed in Thread: SYSBIOS

Hello,

I want to manage my memory map completely via .cmd file (and reconfigure it at build time).

But with RTSC, the linker script is generated by the XDC tools in compliance with platform module (btw useless wheel reinvention) which can't be leaved empty therefore /configPkg/linker.cmd force contain vital sections mapping commands.

How could I auto generate my own memory map commands for any addresses and sections I need?

And why RTLS Tools > Platform New/Edit isn't accessible in both CCS Edit and Debug modes?

  • Alex S said:
    But with RTSC, the linker script is generated by the XDC tools in compliance with platform module (btw useless wheel reinvention) which can't be leaved empty therefore /configPkg/linker.cmd force contain vital sections mapping commands.

    The RTSC generated linker.cmd cannot be avoided, however, you can still add your own custom linker command file in addition. Please see 
    http://processors.wiki.ti.com/index.php/Files_in_CCS_Projects#SYS.2FBIOS_Configuration_files

    Alex S said:
    And why RTLS Tools > Platform New/Edit isn't accessible in both CCS Edit and Debug modes?

    I don't know the reason behind this.  Most of the other functionality under the Tools menu belongs only in the Debug perspective, although I can see how the RTSC Platform view/edit menu items could be in both perspectives or even just in Edit. I will file a request for this.

  • AartiG said:
    The RTSC generated linker.cmd cannot be avoided, however, you can still add your own custom linker command file in addition.

    How could I auto generate my own memory map commands for any addresses and sections I need? Such as .text, .data, .const. Without duplication sections in out elf file and memory range or memory fit errors as a result of my and forced default commands conflict.

    I need to manage all my executable but not just "additional custom sections".

  • Alex S said:
    How could I auto generate my own memory map commands for any addresses and sections I need?

    You would need to create your own custom RTSC platform or start with and modify a base platform provided with the RTSC tools. 

    If you have specific questions on that or need further assistance I would suggest starting a new post in the TI-RTOS forum for the experts there to answer.

  • AartiG said:
    You would need to create your own custom RTSC platform or start with and modify a base platform provided with the RTSC tools. 

    It is manual prebuild operation but I'm asking about automatic.

    I have multicore project and want to store memory map for all cores projects in one file and change it by some buildtime rules on the fly before linking. How can I achieve this simple thing?

    By editing and synchronizing all dozen of platforms manually??

    AartiG said:
    If you have specific questions on that or need further assistance I would suggest starting a new post

    I still yet have the question in the subject of this thread and no answer for it.

  • I am not aware of a way to avoid creating a RTSC platform altogether when working with RTSC projects, however the experts in the TI-RTOS forum may be able to suggest another way. I will move the thread to that forum.

  • Alex,

    What device are you on and what version of SYSBIOS or XDCTOOLS are you using?

    Judah
  • Alex,
    the most RTSC-friendly way to automate a memory map generation based on a buildtime variable is to create your own platform package, which will then generate an appropriate memory map. However, it is an advanced RTSC topic and requires more familiarity with the RTSC flow. Here is an unfinished user guide, which is a good starting point but would also require reading other topics in RTSCpedia: http://rtsc.eclipse.org/docs-tip/Creating_Platform_Packages. Let me know if you want to try that.

    There is a quick alternative way, but you would lose a little bit of automation with it. You would first completely disable RTSC-generated command files by setting Program.linkTemplate in your CFG script like this:
    Program.linkTemplate = "../custom.cmd";
    and then in the top of your project, create a file custom.cmd with only a comment in it to prevent the linker from complaining:
    /* Comment to prevent linker errors */

    Now, create your own linker command file with as many memory maps and SECTIONS directives as you want and refer to this thread for an example how to use linker conditionals - https://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/199803/710884. For a longer explanation look into a TI Assembly Language Tools Guide for your processor and look for the section "Link Command File Preprocessing".
    But before you do all this, save the content of the previously generated RTSC linker command file becuase you'll need to add pieces of that file back to custom.cmd. You'll probably have to add back all of it other than MEMORY and SECTIONS directives.

    The main disadvantage of this approach is that if you change your SYS/BIOS configuration, add or remove some package references form the CFG script, you would have to comment out your Program.linkTemplate setting, regenerate the RTSC linker command file and copy it back to your custom.cmd.

  • Oh, at last! This is I'm looking for. Thank you.