[ABANDONED] RAM Memory Segment Program Section size ignored?

  • Hi, first time posting here.

    I have reserved a section in my RAM memory segment called 'my_non_init' (as highlighted in the screenshot attached) and gave it a size of 0x1000.

    1. A size of 0x1000 stands for 4096 bytes, right?
    2. Since I have reserved 4096 bytes (4kB) but the Memory View shows 24.1kB, why don't I get a compilation error?

    It is essential for me to know the amount of bytes needed/reserved to be able to block the same amount of non initialized memory in the bootloader.

    Thanks!

  • Hi,

    in Embedded Studio V5 the size attribute defined the minimum size of a section.
    If you would have placed less than 0x1000 bytes into this section, it would have been expanded.

    See line 6 of the generated linker script:


    Embedded Studio V6.32 adds an additional assert to also make the attribute the maximum size of a section:

    Code
    . = ASSERT(__my_non_init_size__ <= 0x1000 , "error: .my_non_init is larger than specified size");

    If that is the behavior you would expect, you could upgrade to the latest version of Embedded Studio, or change your project to use a custom linker script which includes the additional assert.

    - Johannes

    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: https://www.segger.com/ticket/

    Or you can contact us via e-mail.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!