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.

defining new section of memory in linker file

Other Parts Discussed in Thread: MSP430FR5969

hi,

i am using msp430FR5969 for a project. i am able to define new section of memory in linker file using the pragma directive in ccs. but when i am trying to do the same with IAR, its not working as linker file is completely different for both of them.so can you tell me how to make new sections of memory by changing the address in the linker file in IAR?

  • Hi Anup,

    Can you explain a little bit more about what you are trying to do - what you are trying to make a new section for? Are you trying to use some of your FRAM to store variables maybe? It might be helpful if you show what your CCS version of this part of your code and linker file looks like so that we can see what you are doing.

    As a note, for IAR there are a compiler guide and linker guide both included in the installation that have lots of good information like this. In IAR, simply go to Help > and then there will be a dropdown including the C/C++ Compiler User Guide and a Linker and Library Tools Reference Guide that might have some of the information you need to better understand the IAR linker files.

    Regards,
    Katie
  • hi Katie,

    i am trying to decrease the size of heap segment and form a new segment from the remaining area of the heap. so that i can place variables on to this memory. my ram is mostly full, and i am unable to build the code. IN ccs i can easily change the linker file and change the length as well as add/delete segments from it. but in iar something like this is not happening.

    thanks for the suggestion of reading the linker and compiler documents of the IAR. i will go through them and if i found out something i will share.

  • Hi Anup,

    If you want to place some variables into FRAM since you are running out of space in RAM, you can do this very simply in IAR by using the __persistent attribute when defining your variable that you want to place there. For example: __persistent int framVar = 0; You can do the same thing with arrays, etc too. There is more information in this FRAM best practices guide www.ti.com/.../slaa628 section 3.4.2 about how this works in IAR. As a note, you would use #pragma PERSISTENT in CCS to do essentially the same thing (described in section 3.4.1 in SLAA628).

    The advantage that this has, is that using the persistent keyword will work well with the built in MPU tool in CCS and IAR for setting up your MPU automatically - you won't have to specify memory regions to have different permissions, because the linker will know that the persistent variables should go in the FRAM read + write permission section.

    I hope that this helps give you some ideas for more options.

    Regards,
    Katie
  • ANUP Sharma41 said:
    i am trying to decrease the size of heap segment and form a new segment from the remaining area of the heap. so that i can place variables on to this memory. my ram is mostly full, and i am unable to build the code.

    In the IAR tools, you change the size of the heap in the IDE. Any ram not used by the heap is available for plain variables to use, so there will be no need to modify the linker command file.

    In addition, if you don't use the heap at all (which is a good convention in an embedded system), it will be excluded from the application all together, so that all available memory can be used by the stack and global variables.

        -- Anders Lindgren, IAR Systems

  • thanks anders and katie

**Attention** This is a public forum