Chapter 4. API Guides
What happens to my_src3.o? Since it is not specified, default placements are used for my_src3.o. More on
default placements here.
Placing symbols
Continuing our example, suppose that among functions defined under object1.o, only
my_function1 is performance-critical; and under object2.o, only my_function2 needs to execute after
the chip comes out of deep sleep. This could be accomplished by writing:
[mapping:my_component]
archive: libmy_component.a
entries:
my_src1:my_function1 (noflash)
my_src2:my_function2 (rtc)
The default placements are used for the rest of the functions in my_src1.o and my_src2.o and the entire ob-
ject3.o. Something similar can be achieved for placing data by writing the variable name instead of the function
name, like so:
my_src1:my_variable (noflash)
Warning: There are
limitations
an alternative would be to group relevant code and data into source files, and
Placing entire archive
In this example, suppose that the entire component archive needs to be placed in RAM.
This can be written as:
[mapping:my_component]
archive: libmy_component.a
entries:
* (noflash)
Similarly, this places the entire component in RTC memory:
[mapping:my_component]
archive: libmy_component.a
entries:
* (rtc)
Configuration-dependent placements
ment when a certain condition is true; for example, when CONFIG_PERFORMANCE_MODE == y. This could be
written as:
[mapping:my_component]
archive: libmy_component.a
entries:
if PERFORMANCE_MODE = y:
* (noflash)
else:
* (default)
For
a
more
complex
CONFIG_PERFORMANCE_LEVEL
FIG_PERFORMANCE_LEVEL
FIG_PERFORMANCE_LEVEL
these three are false however, put entire library in RTC memory. This scenario is a bit contrived, but, it can be
written as:
Espressif Systems
in placing code/data at symbol granularity. In order to ensure proper placements,
Suppose that the entire component library should only have special place-
config-dependent
placement,
==
1,
==
2,
object1.o
==
3 all object files under the archive are to be put into RAM. When
1413
Submit Document Feedback
use object-granularity
suppose
the
following
only object1.o is put in RAM; when CON-
and
object2.o;
placements.
requirements:
when
and
when
CON-
Release v4.4
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?