Microchip® Advanced Software Framework

m2m_flash.c File Reference

WINC Flash Interface.

Copyright (c) 2017-2019 Microchip Technology Inc. and its subsidiaries.

#include "driver/include/m2m_flash.h"
#include "spi_flash/include/spi_flash.h"
#include "spi_flash/include/spi_flash_map.h"
#include "driver/source/nmdrv.h"

Data Structures

struct  tstrFlashMapEntry
 

Functions

static uint8 crc7 (uint8 crc, const uint8 *buff, uint16 len)
 
static bool find_flash_section (tenuWincFlashRegion enuRegion, uint32 *pu32StartAddr, uint32 *pu32Size)
 
sint8 m2m_flash_erase_sector (tenuWincFlashRegion enuRegion, uint8 u8StartSector, uint8 u8NumSectors)
 Erase one or more sectors within a WINC flash region. More...
 
sint8 m2m_flash_read (tenuWincFlashRegion enuRegion, void *pvBuffer, uint32 u32Offset, uint32 u32Size)
 Read the number of bytes specified from a WINC flash location. More...
 
sint8 m2m_flash_switch_firmware (void)
 Switch the active and inactive firmware images. More...
 
sint8 m2m_flash_write (tenuWincFlashRegion enuRegion, void *pvBuffer, uint32 u32Offset, uint32 u32Size)
 Write the number of bytes specified to a WINC flash location. More...
 
static sint8 read_control_structure (tstrOtaControlSec *pstrControlSec)
 
static sint8 update_control_structure (tstrOtaControlSec *pstrControlSec)
 
static sint8 verify_control_structure (tstrOtaControlSec *pstrControlSec)
 
static sint8 winc_flash_compare (uint8 *pu8Buf, uint32 u32Offset, uint32 u32Size)
 
static sint8 winc_flash_write_verify (uint8 *pu8Buf, uint32 u32Offset, uint32 u32Size)
 

Variables

static const tstrFlashMapEntry flashMap []
 

static uint8 crc7 ( uint8  crc,
const uint8 buff,
uint16  len 
)
static

References i, and len.

Referenced by update_control_structure(), and verify_control_structure().

static sint8 winc_flash_compare ( uint8 pu8Buf,
uint32  u32Offset,
uint32  u32Size 
)
static
static sint8 winc_flash_write_verify ( uint8 pu8Buf,
uint32  u32Offset,
uint32  u32Size 
)
static

const tstrFlashMapEntry flashMap[]
static
Initial value:
=
{
{0 , 0 },
{0 , OTA_IMAGE_SIZE },
{0 , OTA_IMAGE_SIZE },
}
#define OTA_IMAGE_SIZE
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:234
#define M2M_TLS_SERVER_FLASH_SZ
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:148
#define M2M_TLS_ROOTCER_FLASH_SZ
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:138
#define M2M_GAIN_FLASH_SZ
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:131
#define M2M_PLL_FLASH_SZ
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:129
#define M2M_TLS_ROOTCER_FLASH_OFFSET
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:137
#define M2M_HTTP_MEM_FLASH_SZ
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:212
#define M2M_TLS_SERVER_FLASH_OFFSET
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:147
#define M2M_CACHED_CONNS_FLASH_OFFSET
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:154
#define M2M_CACHED_CONNS_FLASH_SZ
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:155
#define M2M_PLL_FLASH_OFFSET
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:123
#define M2M_GAIN_FLASH_OFFSET
Definition: winc3400/wifi_drv/spi_flash/include/spi_flash_map.h:130