Microchip® Advanced Software Framework

fuota_nvm.h File Reference

Interface headers for accessign NVM to perform FUOTA image related storage.

Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries.

#include "status_codes.h"

Data Structures

struct  _FotaImageHeader
 
struct  app_info_t
 
struct  app_table_tag
 
struct  BootInfo_t
 
struct  ExistingImageInfo_t
 
struct  featureBits_t
 
union  featureMask_t
 

Macros

#define APP_INFO_START_ADDRESS   (0x0003FE00)
 
#define FLASH_AREA_IMAGE_1_BASE_OFFSET   (0x00004000)
 
#define FLASH_AREA_IMAGE_2_BASE_OFFSET   (0x00022000)
 
#define FLASH_AREA_IMAGE_HEADER_FILL   (32)
 
#define FUOTA_NVM_TYPE   (TYPE_INTERNAL)
 
#define TYPE_EXTERNAL   (1)
 
#define TYPE_INTERNAL   (0)
 

Typedefs

typedef struct app_table_tag app_table_t
 
typedef struct _FotaImageHeader FotaImageHeader_t
 

Functions

status_code_t FUOTA_NVM_Init (void)
 Initialize the non volatile memory specified. More...
 
status_code_t FUOTA_NVM_Read (uint32_t address, void *buffer, uint32_t len)
 Read len number of bytes from address address in non volatile memory mem and store it in the buffer buffer. More...
 
status_code_t FUOTA_NVM_Write (uint32_t address, void *buffer, uint32_t len)
 Write len number of bytes at address address in non volatile memory mem from the buffer buffer. More...
 

#define APP_INFO_START_ADDRESS   (0x0003FE00)
#define FLASH_AREA_IMAGE_1_BASE_OFFSET   (0x00004000)
#define FLASH_AREA_IMAGE_2_BASE_OFFSET   (0x00022000)
#define FLASH_AREA_IMAGE_HEADER_FILL   (32)
#define FUOTA_NVM_TYPE   (TYPE_INTERNAL)
#define TYPE_EXTERNAL   (1)

Referenced by memcopy().

#define TYPE_INTERNAL   (0)

Referenced by clear_updateaction(), and memcopy().

typedef struct app_table_tag app_table_t

status_code_t FUOTA_NVM_Init ( void  )

Initialize the non volatile memory specified.

References nvm_init(), and STATUS_OK.

status_code_t FUOTA_NVM_Read ( uint32_t  address,
void *  buffer,
uint32_t  len 
)

Read len number of bytes from address address in non volatile memory mem and store it in the buffer buffer.

Parameters
addressAddress to read
bufferPointer to destination buffer
lenNumber of bytes to read

References STATUS_BUSY, and STATUS_OK.

status_code_t FUOTA_NVM_Write ( uint32_t  address,
void *  buffer,
uint32_t  len 
)

Write len number of bytes at address address in non volatile memory mem from the buffer buffer.

Parameters
addressAddress to write
bufferPointer to source buffer
lenNumber of bytes to write

References STATUS_OK.