XDK API  3.6.0
Documentation
Macros | Functions
FOTA.c File Reference

This module will handle, FOTA related activities -Firmware validation in the SD Card -Firmware update from the SD Card. More...

#include "XdkCommonInfo.h"
#include "BCDS_Fota.h"
#include "XDK_FOTA.h"
#include "XDK_Storage.h"
#include "ff.h"
#include "BCDS_NVMConfig.h"
#include "BCDS_Retcode.h"
#include "FreeRTOS.h"
#include "timers.h"
#include "BCDS_BSP_Board.h"
#include "BCDS_SDCard_Driver.h"
#include "BCDS_CRC.h"
#include "BCDS_MCU_Flash.h"
+ Include dependency graph for FOTA.c:

Macros

#define BCDS_MODULE_ID   XDK_COMMON_ID_FOTA
 
#define FIRMWARE_NAME   "firmware.bin"
 

Functions

Retcode_T FOTA_ReadFirmwareCRC (Fota_PartitionInfo_T partitionInfo, uint32_t *firmwareCRC)
 This function reads the Fota container firmware CRC on the fota header from the specified partition. More...
 
Retcode_T FOTA_ReadFirmwareVersion (Fota_PartitionInfo_T partitionInfo, uint32_t *FirmwareVer)
 This function reads the Fota container firmware version on the fota header from the specified partition. More...
 
Retcode_T FOTA_ReadHeader (Fota_PartitionInfo_T partitionInfo, FWContainer_Header_T *Header)
 This function reads the Fota container header from the specified partition. More...
 
Retcode_T FOTA_UpdateSdcardFw (void)
 This function Triggers an firmware update from Sdcard. More...
 
Retcode_T FOTA_ValidateSdcardFw (const char *firmwareName)
 This function Validates the firmware in the Sdcard. More...
 
static Retcode_T VerifyHeader (FWContainer_Header_T *header)
 Verifies the Header CRC & firmware size of the given fota container. More...
 
static Retcode_T VerifyImage (Fota_PartitionInfo_T *partitionInfo, uint8_t *optBuffer)
 Verifies the firmware CRC of the given fota container partition. More...
 

Macro Definition Documentation

#define BCDS_MODULE_ID   XDK_COMMON_ID_FOTA
#define FIRMWARE_NAME   "firmware.bin"

Filename to open/write/read from SD-card

Function Documentation

static Retcode_T VerifyHeader ( FWContainer_Header_T header)
static
Parameters
[in]headerpointer to a buffer holding the fota container header data.
[in]statusRETCODE_OK if header CRC is passed & firmware size is within the maximum range or an error code otherwise.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static Retcode_T VerifyImage ( Fota_PartitionInfo_T partitionInfo,
uint8_t *  optBuffer 
)
static
Parameters
[in]partitionInfomention the partition information for which header firmware CRC needs to be verified. In-case of FOTA_PARTITION_DOWNLOADED specify the file name Incase of FOTA_PARTITION_PRIMARY file name is not used, can be NULL.
[in]optBufferOperation buffer from the application where blocks of the firmware is kept for the CRC calculation.
Note
  • Make sure minimum buffer size of optBuffer is sizeof(Fota_PartitionInfo_T).
  • Storage_Setup & Storage_Enable must be called prior to using this API.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:41 by doxygen 1.8.8