I want the ___lib_setup_c code runs from internal memory, which compilation or linking option I have to set ?
the ___lib_setup_c routine is defined within the "set_c.asm" file, located in the "...\lib\src" directory. If you take a look at this source file you will see that it has the file attribute "prefersmem = internal". This means that, if at all possible, this function will be placed in internal memory.
It is unlikely that you would need to take any further steps to ensure that this function (which is part of the "libc***.dlb library) is placed in internal memory. Please enable the option to "Generate Symbol Map" under Project Options:Link. If you observe this function being placed in external memory, let us know and we can advise further steps on forcing it's placement.
In attachment you can find the two .xml file for the symbol map. The lib_setup_c routine starting from lib_setup_environment executes from external memory (address 2f331)
Can I place the whole routine in internal memory ?
There are a couple of topics on the forum that discuss mapping objects to specific locations that offer general advice. For example:
Mapping run-time library objects to specific memory sections
Looking at your XML Map file, I'm assuming you are using a highly customized LDF file, so in order to advise further I would need to take a look at the LDF - if possible the entire project.
So, I would recommend that you contact us through private support so that we can offer specific advice on modifying your application to ensure that these functions are placed in internal memory. You can do so via the following URL, please include a link to this forum topic.
Retrieving data ...