Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
spi_flash_erase

Functions

sint8 spi_flash_erase (uint32 u32Offset, uint32 u32Sz)
 Erase a specified portion of SPI Flash.
. More...
 

sint8 spi_flash_erase ( uint32  u32Offset,
uint32  u32Sz 
)

Erase a specified portion of SPI Flash.
.

Parameters
[in]u32OffsetAddress (Offset) to erase from the SPI flash.
[in]u32SzSize of SPI flash required to be erased.
Note
It is blocking function
Warning
  • Address (offset) plus size of data must not exceed flash size.
  • No firmware is required for writing to SPI flash.
    • In case of there is a running firmware, it is required to pause your firmware first before any trial to access SPI flash to avoid any racing between host and running firmware on bus using m2m_wifi_download_mode
    • It is blocking function
See Also
m2m_wifi_download_mode, spi_flash_get_size
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

References FLASH_PAGE_SZ, M2M_PRINT, M2M_SUCCESS, spi_flash_read_status_reg(), spi_flash_sector_erase(), and spi_flash_write_enable().