Microchip® Advanced Software Framework

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

Functions

sint8 spi_flash_read (uint8 *pu8Buf, uint32 u32Addr, uint32 u32Sz)
 Read a specified portion of data from SPI Flash.
. More...
 
sint8 spi_flexible_flash_find_section (uint16 u16EntryIDToLookFor, uint32 *pu32StartOffset, uint32 *pu32Size)
 Read the Flash Map to extract the host file starting offset.
. More...
 

sint8 spi_flash_read ( uint8 pu8Buf,
uint32  u32offset,
uint32  u32Sz 
)

Read a specified portion of data from SPI Flash.
.

Parameters
[out]pu8BufPointer to data buffer which will be filled with data in case of successful operation.
[in]u32AddrAddress (Offset) to read from at the SPI flash.
[in]u32SzTotal size of data to be read in bytes
Warning
  • Address (offset) plus size of data must not exceed flash size.
  • No firmware is required for reading from 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
Note
  • 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.
Parameters
[out]pu8BufPointer to data buffer which will fill in with data in case of successful operation.
[in]u32AddrAddress (Offset) to read from at the SPI flash.
[in]u32SzTotal size of data to be read in bytes
Warning
  • Address (offset) plus size of data must not exceed flash size.
  • No firmware is required for reading from 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
Note
  • 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_BLOCK_SIZE, M2M_SUCCESS, ret, and spi_flash_read_internal().

Referenced by m2m_flash_read(), m2m_ota_host_file_read_spi(), read_control_structure(), spi_flexible_flash_find_section(), and winc_flash_compare().

sint8 spi_flexible_flash_find_section ( uint16  u16EntryIDToLookFor,
uint32 pu32StartOffset,
uint32 pu32Size 
)

Read the Flash Map to extract the host file starting offset.
.

Parameters
[in]u16EntryIDToLookForThe ID of the location in Flash we are looking for. See tenuFlashLUTEntryID.
[in]pu32StartOffsetPointer to the variable where the Flash section start address should be stored.
[in]pu32SizePointer to the variable where the Flash section size should be stored.
Warning
In case there is a running WINC firmware, it is required to pause the firmware first before any trial to access SPI flash to avoid any racing between host and running firmware on bus. m2m_wifi_download_mode can be used to pause the firmware.
See Also
m2m_wifi_download_mode m2m_wifi_init_hold
Returns
The function returns M2M_SUCCESS for successful operations and a negative value otherwise.

References FLASH_MAP_TABLE_ADDR, FLASH_SECTOR_SZ, M2M_ERR_FAIL, M2M_ERR_INVALID_ARG, M2M_SUCCESS, N_ENTRIES_MAX, NULL, and spi_flash_read().

Referenced by m2m_ota_host_file_read_spi().