Microchip® Advanced Software Framework

app_info.c File Reference

Implementation of app_info table handling .

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

#include <types.h>
#include <app_info.h>
#include <bootStructure.h>
#include <appEntry.h>
#include <eepromLoader.h>
#include <flashLoader.h>
#include "hardwareInit.h"

Macros

#define APP_INFO_START_ADDRESS   0x0003FE00
 
#define IMG_BASE2_START_ADDRESS   0x00022000
 

Functions

void app_infoAction (void)
 
void clear_updateaction (uint8_t app_index)
 
void extReadDataForFlashArea (uint32_t ext_addr, uint32_t int_addr, uint32_t size, uint8_t img_type, uint8_t *key, uint8_t app_index)
 
bool img_hdr_validate (void)
 
uint8_t MemcalcCrc (uint8_t crc, uint8_t *pcBlock, uint8_t length)
 Read EEPROM index 39 to 46, and populate skip offsets. More...
 
void memcopy (uint8_t dst_mem, uint32_t dst_addr, uint8_t src_mem, uint32_t src_addr, uint8_t img_type, uint32_t img_size, uint8_t app_index)
 
bool readapp_infotable (void)
 
void update_action (void)
 
void update_boot_info (void)
 
void writeapp_infotable (void)
 

Variables

uint32_t alignedPayloadLen
 
app_info_t checkapp_info
 
BootBuffer_t dataBuffer
 
bool isCrcMatched = false
 
uint32_t otauFileHdrLen
 
uint32_t otauFileId
 
uint32_t otauFileLen
 
uint16_t otauHdrImgType
 
uint32_t payloadLen
 
uint32_t payloadOffset
 
uint16_t remainderData
 

#define APP_INFO_START_ADDRESS   0x0003FE00
#define IMG_BASE2_START_ADDRESS   0x00022000

Referenced by img_hdr_validate().

void app_infoAction ( void  )

References isCrcMatched, readapp_infotable(), and update_action().

Referenced by Boot_main().

void extReadDataForFlashArea ( uint32_t  ext_addr,
uint32_t  int_addr,
uint32_t  size,
uint8_t  img_type,
uint8_t *  key,
uint8_t  app_index 
)

Referenced by memcopy().

bool img_hdr_validate ( void  )
uint8_t MemcalcCrc ( uint8_t  crc,
uint8_t *  pcBlock,
uint8_t  length 
)

Read EEPROM index 39 to 46, and populate skip offsets.

Reads data from external flash and loads to internal flash. Counts crc given memory block. CRC-8. Polynom 0x31 x^8 + x^5 + x^4 + 1.

Parameters
[in]crc- first crc state
[in]pcBlock- pointer to the memory for crc counting
[in]length- memory size
Returns
current area crc

Referenced by img_hdr_validate(), readapp_infotable(), update_boot_info(), and writeapp_infotable().

void memcopy ( uint8_t  dst_mem,
uint32_t  dst_addr,
uint8_t  src_mem,
uint32_t  src_addr,
uint8_t  img_type,
uint32_t  img_size,
uint8_t  app_index 
)
bool readapp_infotable ( void  )

uint32_t alignedPayloadLen
app_info_t checkapp_info
BootBuffer_t dataBuffer
uint32_t otauFileHdrLen
uint32_t otauFileId
uint32_t otauFileLen
uint16_t otauHdrImgType
uint32_t payloadLen
uint32_t payloadOffset
uint16_t remainderData