Function esp_idf_hal::sys::esp_partition_write_raw
source · pub unsafe extern "C" fn esp_partition_write_raw(
partition: *const esp_partition_t,
dst_offset: usize,
src: *const c_void,
size: usize,
) -> i32
Expand description
@brief Write data to the partition without any transformation/encryption.
@note This function is essentially the same as \c esp_partition_write() above. It just never encrypts data but writes it as is.
Before writing data to flash, corresponding region of flash needs to be erased. This can be done using esp_partition_erase_range function.
@param partition Pointer to partition structure obtained using esp_partition_find_first or esp_partition_get. Must be non-NULL. @param dst_offset Address where the data should be written, relative to the beginning of the partition. @param src Pointer to the source buffer. Pointer must be non-NULL and buffer must be at least ‘size’ bytes long. @param size Size of data to be written, in bytes.
@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 partition 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.