Function esp_idf_hal::sys::esp_flash_write
source ยท pub unsafe extern "C" fn esp_flash_write(
chip: *mut esp_flash_t,
buffer: *const c_void,
address: u32,
length: u32,
) -> i32
Expand description
@brief Write data to the SPI flash chip
@param chip Pointer to identify flash chip. If NULL, esp_flash_default_chip is substituted. Must have been successfully initialised via esp_flash_init() @param address Address on flash to write to. Must be previously erased (SPI NOR flash can only write bits 1->0). @param buffer Pointer to a buffer with the data to write. To get better performance, this should be in the DRAM and word aligned. @param length Length (in bytes) of data to write.
There are no alignment constraints on buffer, address or length.
@return - ESP_OK on success, - ESP_FAIL, bad write, this will be detected only when CONFIG_SPI_FLASH_VERIFY_WRITE is enabled - ESP_ERR_NOT_SUPPORTED if the chip is not able to perform the operation. This is indicated by WREN = 1 after the command is sent. - Other flash error code if operation failed.