Get size of a memory segment

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Get size of a memory segment

    I am trying to find the size of a memory segment. In this specific case it should be easy since I only have one section in the memory segment. According to the docs for the section placement file format, one can add a size_symbol. If my understanding is correct, then I could access the value through this symbol in the application code. I tried this:
    <MemorySegment name="$(ITCM_NAME:ITCM)">
    <ProgramSection alignment="4" load="No" size_symbol="__itcm_size__" name=".code_TCM_run" />
    </MemorySegment>
    But it does not lead to creating such a symbol. Am I understanding the use of size_symbol correctly ? If yes, then how can I use it to do what I need ?
    George
  • Hello George,

    But it does not lead to creating such a symbol. Am I understanding the use of size_symbol correctly ? If yes, then how can I use it to do what I need ?

    You are understanding the documentation correctly. Unfortunately there seems to be an issue currently with that functionality.
    We are investigating if this is wrong behaviour or a mistake in documentation.

    Nonetheless you have a working alternative you can use. Per default each section creates a size symbol the following way: __<sectionname>_size__
    It does not matter if you have called size_symbol or not, the mentioned symbol is always created and can be used.
    Keep in mind that this symbol is treated like a address pointer and needs to be called accordingly.

    Sorry for any inconveniences caused.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.