[SOLVED] How to place whole library in specific memory segment

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

  • [SOLVED] How to place whole library in specific memory segment

    Hi all,
    I'm a student and very new with the SEGGER Embedded Studio. I use a STM32L4 uC and the Version 3.34b of the Embedded Studio.
    I'm working on a Project where I need to place a whole selfmade library (which contains a lot of object files) at a specific adress in flash.
    I already found out how to place a function on a specific adress (with the __attribute__ ((section(".mydata")))) so I already worked with the memory-map-xml-file and the section-placement-xml-file.
    Now: how is it possible to place whole libraries (.text, .data and .rodata) in an own memory Segment? Or at least place whole object files?
    Many thanks in advance! :)
    Nico
  • Hello Nico,

    Thank you for your inquiry.
    Depends on what you are trying to achieve.
    Usually libraries get included in projects so you have an additional set of API functions that can be used in your project.
    So when you compile your project only the parts that were actually used will end up in memory.
    If you use the library like this then it should be possible to place specific library functions to specific addresses like you already do with your own functions.

    I'm working on a Project where I need to place a whole selfmade library (which contains a lot of object files) at a specific adress in flash.

    This sounds more like you want to treat your whole library as one data block.
    In that case you can set additional load files in your Embedded Studio project under Project Options->Debug->Loader. Here you can now set additional load files which will simply be loaded into memory at debug start which then e.g. can be accessed by your application.

    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.