AM263Px MCU+ SDK: APIs for FOTA Agent

| AM263Px MCU+ SDK 26.00.00 |

Files | Data Structures | Functions | Macros
APIs for FOTA Agent
APIs for SOC Specific Device Drivers

## Introduction

This module contains APIs to program and use the FOTA Agent driver.

## Files
file | fota_agent.h
| FOTA Agent Driver API/interface file.

## Data Structures
struct | FOTAAgent_Params
| FOTA Agent Driver Handle. More...
struct | FOTAAgent_Handle

## Functions
int32_t | FOTAAgent_Params_init (FOTAAgent_Params *params)
| Initilize params with default values. More...
int32_t | FOTAAgent_init (FOTAAgent_Handle *pHandle, FOTAAgent_Params *params)
| Initilize FOTA Agent API. More...
int32_t | FOTAAgent_writeStart (FOTAAgent_Handle *pHandle, uint32_t wrOffset, char doFlashSegments)
| Logically start writes and initilize state internal machine. More...
int32_t | FOTAAgent_writeUpdate (FOTAAgent_Handle *pHandle, uint8_t *buf, uint32_t size)
| Update internal machine with new data. More...
int32_t | FOTAAgent_writeEnd (FOTAAgent_Handle *pHandle)
| Logically end writes and end the state machine. More...
int32_t | FOTAAgent_getFLSOPSKDHandle (FOTAAgent_Handle *pHandle, FLSOPSKD_Handle *flsopskdHandle)
| Retrive FLSOPSKD handle. More...

## Macros
#define | FOTAAGENT_WRITEOFFSET_DNC (0U)

## Macro Definition Documentation

## ◆ FOTAAGENT_WRITEOFFSET_DNC

#define FOTAAGENT_WRITEOFFSET_DNC (0U)

## Function Documentation

## ◆ FOTAAgent_Params_init()

int32_t FOTAAgent_Params_init | ( | FOTAAgent_Params * | params | ) |

Initilize params with default values.

Parameters

  params | pointer to parameter struct

Returns
  SystemP_FAILURE
  SystemP_SUCCESS

## ◆ FOTAAgent_init()

int32_t FOTAAgent_init | ( | FOTAAgent_Handle * | pHandle,
|  | FOTAAgent_Params * | params
| ) |  |

Initilize FOTA Agent API.

This API initilize FOTA agent and underneath modules.

Parameters

  pHandle | pointer to FOTA Agent handle
  params | pointer to parameter struct

Returns
  SystemP_FAILURE
  SystemP_SUCCESS

## ◆ FOTAAgent_writeStart()

int32_t FOTAAgent_writeStart | ( | FOTAAgent_Handle * | pHandle,
|  | uint32_t | wrOffset,
|  | char | doFlashSegments
| ) |  |

Logically start writes and initilize state internal machine.

Currently, FOTAAgent only support binary file of format .mcelf and .mcelf_xip. if file type is mcelf_xip then doFlashSegments is TRUE else it is FALSE. doFlashSegments here signals to parse the file, extracts the data segments and only flash those data segments, instead of entire file.

In case doFlashSegments is TRUE, wrOffset argument is ignored as this information is stored inside the file. However, wrOffset information needs to be provided explicitly given via wrOffset argument.

wrOffset argument is the offset (in bytes) at which file needs to be written.

Parameters

  pHandle | pointer to FOTA Agent handle
  wrOffset | flash offset at which file to write
  doFlashSegments | flash data segments only instead of entire file

Returns
  SystemP_FAILURE
  SystemP_SUCCESS

## ◆ FOTAAgent_writeUpdate()

int32_t FOTAAgent_writeUpdate | ( | FOTAAgent_Handle * | pHandle,
|  | uint8_t * | buf,
|  | uint32_t | size
| ) |  |

Update internal machine with new data.

Update internal state machine with new data. Its not that on providing every one byte this function will write to flash. Flash constraints on erase size. For exmaple, if erase is sector wise of 4096 bytes (as specified in params) then in that case, this function will wait for this amount of data to be recieved and then send it to the flash.

Parameters

  pHandle | pointer to FOTA Agent handle
  buf | pointer to buffer with the data
  size | size of buf

Returns
  SystemP_FAILURE
  SystemP_SUCCESS

## ◆ FOTAAgent_writeEnd()

int32_t FOTAAgent_writeEnd | ( | FOTAAgent_Handle * | pHandle | ) |

Logically end writes and end the state machine.

Other than ending the internal state machine, this function will also flash any remaining data that remains to be programmed.

Parameters

  pHandle | pointer to FOTA Agent handle

Returns
  SystemP_FAILURE
  SystemP_SUCCESS

## ◆ FOTAAgent_getFLSOPSKDHandle()

int32_t FOTAAgent_getFLSOPSKDHandle | ( | FOTAAgent_Handle * | pHandle,
|  | FLSOPSKD_Handle * | flsopskdHandle
| ) |  |

Retrive FLSOPSKD handle.

Parameters

  pHandle | [in] pointer to FOTA Agent handle
  flsopskdHandle | [out] pointer to flsopskdHandle

Returns
  SystemP_FAILURE
  SystemP_SUCCESS