Espressif ESP32-S2 Programming Manual page 770

Table of Contents

Advertisement

Chapter 2. API Reference
• size: Size of data to be read, in bytes.
esp_err_t
esp_partition_write_raw(const
Write data to the partition without any transformation/encryption.
Before writing data to flash, corresponding region of flash needs to be erased. This can be done using
esp_partition_erase_range function.
Note This function is essentially the same as
data but writes it as is.
Note Prior to writing to flash memory, make sure it has been erased with esp_partition_erase_range call.
Return ESP_OK, if data was written successfully; ESP_ERR_INVALID_ARG, if dst_offset exceeds parti-
tion size; ESP_ERR_INVALID_SIZE, if write would go out of bounds of the partition; or one of the
error codes from lower-level flash driver.
Parameters
• partition:
esp_partition_get. Must be non-NULL.
• dst_offset: Address where the data should be written, relative to the beginning of the partition.
• src: Pointer to the source buffer. Pointer must be non-NULL and buffer must be at least 'size'
bytes long.
• size: Size of data to be written, in bytes.
esp_err_t
esp_partition_erase_range(const
Erase part of the partition.
Return ESP_OK, if the range was erased successfully; ESP_ERR_INVALID_ARG, if iterator or dst are
NULL; ESP_ERR_INVALID_SIZE, if erase would go out of bounds of the partition; or one of error
codes from lower-level flash driver.
Parameters
• partition:
esp_partition_get. Must be non-NULL.
• offset: Offset from the beginning of partition where erase operation should start. Must be aligned
to 4 kilobytes.
• size: Size of the range which should be erased, in bytes. Must be divisible by 4 kilobytes.
esp_err_t
esp_partition_mmap(const
Configure MMU to map partition into data memory.
Unlike spi_flash_mmap function, which requires a 64kB aligned base address, this function doesn't impose
such a requirement. If offset results in a flash address which is not aligned to 64kB boundary, address will be
rounded to the lower 64kB boundary, so that mapped region includes requested range. Pointer returned via
out_ptr argument will be adjusted to point to the requested offset (not necessarily to the beginning of mmap-ed
region).
To release mapped memory, pass handle returned via out_handle argument to spi_flash_munmap function.
Return ESP_OK, if successful
Parameters
• partition:
esp_partition_get. Must be non-NULL.
• offset: Offset from the beginning of partition where mapping should start.
• size: Size of the area to be mapped.
• memory: Memory space where the region should be mapped
• out_ptr: Output, pointer to the mapped memory region
• out_handle: Output, handle which should be used for spi_flash_munmap call
esp_err_t
esp_partition_get_sha256(const
Get SHA-256 digest for required partition.
For apps with SHA-256 appended to the app image, the result is the appended SHA-256 value for the app
Espressif Systems
esp_partition_t
void *src, size_t size)
esp_partition_write()
Pointer to partition structure obtained using esp_partition_find_first or
esp_partition_t
Pointer to partition structure obtained using esp_partition_find_first or
esp_partition_t
spi_flash_mmap_memory_t
spi_flash_mmap_handle_t *out_handle)
Pointer to partition structure obtained using esp_partition_find_first or
esp_partition_t
759
Submit Document Feedback
*partition, size_t dst_offset, const
above. It just never encrypts
*partition, size_t offset, size_t size)
*partition,
size_t offset,
memory,
const
void
*partition, uint8_t *sha_256)
size_t size,
**out_ptr,
Release v4.4

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ESP32-S2 and is the answer not in the manual?

Table of Contents

Save PDF