Implementation of real time srec parser.
Copyright (c) 2020 Microchip Technology Inc. and its subsidiaries.
#include <types.h>
#include <abstractSerializer.h>
#include <bootStructure.h>
#include <flashLoader.h>
#include <eepromLoader.h>
#include "asf.h"
#include "uartSerializer.h"
#include <appEntry.h>
#include "app_info.h"
Macros | |
#define | EEPROM_PAGE_SIZE 256u |
Functions | |
void | jumpToApplication (void) |
void | srecHandshake (void) |
Handshake procedure. More... | |
static bool | srecParser (void) |
Real time parser of srec format. More... | |
void | srecProtocol (void) |
Communication support between host and mcu. More... | |
static uint8_t | srecWaitForAddress (uint8_t addressLength) |
Waiting for a field of the type from the internal address. More... | |
static void | srecWaitForType (SrecordType_t *srecType) |
Waiting for a field of the type from the serial interface. More... | |
Variables | |
app_info_t | checkapp_info |
BootBuffer_t | dataBuffer |
static uint32_t | handshakeConf = HANDSHAKE_CONF |
static uint32_t | previousAddress = 0xFFFFFFFF |
static uint32_t | srecACK = ACK |
static uint32_t | srecNACK = NACK |
#define EEPROM_PAGE_SIZE 256u |
void jumpToApplication | ( | void | ) |
References app_table_tag::app_start_addr, app_info_t::appTable, CLEAR_EIND, flag, and isCrcMatched.
Referenced by Boot_main().
void srecHandshake | ( | void | ) |
Handshake procedure.
References bootScanInterfaces(), bootSetChar(), bootUnInitSerializer(), flag, handshakeConf, lowLevelUnInit(), RESET_FLAG, and system_reset().
Referenced by Boot_main().
|
static |
Real time parser of srec format.
References bootGetChar(), CHECKSUM_AREA_SIZE, BootBuffer_t::data, BootBuffer_t::dataSize, INFINITE, BootBuffer_t::recordType, S0, S1, S19, S2, S3, S5, S7, S9, SREC_DATA_LENGTH, srecWaitForAddress(), and srecWaitForType().
Referenced by srecProtocol().
void srecProtocol | ( | void | ) |
Communication support between host and mcu.
References BootBuffer_t::address, bootSetChar(), bootUnInitSerializer(), BootBuffer_t::dataSize, EEPROM_END_ADDRESS, EEPROM_START_ADDRESS, eepromFlushPage(), eepromPacketToPage(), flag, FLASH_END_ADDRESS, flashFlushPage(), flashPacketToPage(), lowLevelUnInit(), nvm_erase_row(), previousAddress, BootBuffer_t::recordType, RESET_FLAG, S0, S19, S5, S7, S9, srecACK, srecNACK, srecParser(), and system_reset().
Referenced by Boot_main().
|
static |
Waiting for a field of the type from the internal address.
[in] | addressLength | - length of address field; |
References BootBuffer_t::address, bootGetChar(), and INFINITE.
Referenced by srecParser().
|
static |
Waiting for a field of the type from the serial interface.
[out] | srecType | - pointer to buffer; |
References bootGetChar(), INFINITE, and S_SYMBOL.
Referenced by srecParser().
app_info_t checkapp_info |
BootBuffer_t dataBuffer |
|
static |
Referenced by srecHandshake().
|
static |
Referenced by srecProtocol().
|
static |
Referenced by srecProtocol().
|
static |
Referenced by srecProtocol().