Chapter 4. API Guides
4.19.5 DROM (data stored in Flash)
By default, constant data is placed by the linker into a region mapped to the MMU flash cache. This is the same as
the
IROM (code executed from Flash)
The only constant data not placed into into this memory type by default are literal constants which are embedded by
the compiler into application code. These are placed as the surrounding function's executable instructions.
The DRAM_ATTR attribute can be used to force constants from DROM into the
above).
4.19.6 RTC slow memory
Global and static variables used by code which runs from RTC memory must be placed into RTC slow memory. For
example
deep sleep
variables can be placed here instead of RTC fast memory, or code and variables accessed by the
ULP Coprocessor
programming.
The attribute macro named RTC_NOINIT_ATTR can be used to place data into this type of memory. The values
placed into this section keep their value after waking from deep sleep.
Example:
RTC_NOINIT_ATTR
uint32_t
4.19.7 DMA Capable Requirement
Most peripheral DMA controllers (e.g. SPI, sdmmc, etc.) have requirements that sending/receiving buffers should
be placed in DRAM and word-aligned. We suggest to place DMA buffers in static variables rather than in the stack.
Use macro DMA_ATTR to declare global/local static variables like:
DMA_ATTR
uint8_t
buffer[]="I want to send
void
app_main()
{
// initialization code...
spi_transaction_t temp
.tx_buffer
=
.length
=
8
};
spi_device_transmit(spi, &temp);
// other stuff
}
Or:
void
app_main()
{
DMA_ATTR
static
// initialization code...
spi_transaction_t temp
.tx_buffer
=
.length
=
8
};
spi_device_transmit(spi, &temp);
// other stuff
}
It is also possible to allocate DMA-capable memory buffers dynamically by using the
bilities flag.
Espressif Systems
section, but is for read-only data not executable code.
rtc_noinit_data;
=
{
buffer,
*
sizeof(buffer),
uint8_t
buffer[]
=
"I want to send
=
{
buffer,
*
sizeof(buffer),
Submit Document Feedback
something";
something";
1423
DRAM (Data RAM)
section (see
MALLOC_CAP_DMA
Release v4.4
capa-
Need help?
Do you have a question about the ESP32-S2 and is the answer not in the manual?
Questions and answers