[ABANDONED] Section definition by Linker

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

  • [ABANDONED] Section definition by Linker

    I'm tryng to define some section with a string by Linker. But Linker outputs "linker expression evaluates to undefined when constant expected".
    To do this, I use udata8 type. Is there any other type to definition section? Are there any other types besides udata8, udata16, udata32, sdata8, sdata16, sdata32 for Linker?

    Code example:
    Display Spoiler


    Source Code

    1. define section .data.mix {
    2. udata8 "Some string", udata8 'c', udata8 0x00, udata16 0x0000};
    3. define block Mix{
    4. section .data.mix
    5. };
    6. define region MixBlock = [start(RAM)+4k size (26*1)];
    7. place in MixBlock {block Mix};
    8. place in RAM1 { section .RAM1, section .RAM1.* };
    9. //
    10. // RAM Placement
    11. //
    12. place at start of RAM { block vectors_ram };
    13. place in RAM {// block TTable,
    14. section .non_init, section .non_init.*,
    15. block tls
    16. };
    17. place in RAM with auto order { section .fast, section .fast.*,
    18. section .data, section .data.*,
    19. section .bss, section .bss.* // Catch-all for zero-initialized data sections (e.g. .bss)
    20. };
    21. place in RAM { block heap}; // Heap reserved block
    22. place at end of RAM with fixed order { block stack_process,
    23. block stack };
    Display All
  • Hello,

    Thank you for your inquiry.
    You are using invalid linker syntax.

    If you want to place data you first need to define it in your targetapplication so a symbol gets assigned to it which then you can place in your linker script.

    It looks like you are trying to place a constant string in your firmware, correct?
    In this case do as follows:
    wiki.segger.com/How_to_place_variables_in_Flash

    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.