GBL ParserPlugin > Image Parser

Description

GBL parser implementation.

Image parser for GBL files. Parses GBL files based on the GBL file format specification . Callbacks are used to present data and metadata contents of the GBL file to the bootloader.

Modules

Custom GBL Tags
Handle custom GBL tags for added functionality in the GBL parser.
GBL Format
GBL file specification.

Data Structures

struct ParserContext_t
Image parser context definition.

Macros

#define PARSER_FLAG_ENCRYPTED (1U << 0U)
GBL file is encrypted.
#define PARSER_FLAG_IS_EBLV2 (1U << 3U)
File is an EBL (version 2)
#define PARSER_FLAG_PARSE_CUSTOM_TAGS (1U << 5U)
Parse custom tags rather than silently traversing them.
#define PARSER_FLAGS_PUBLIC_MASK ( PARSER_FLAG_PARSE_CUSTOM_TAGS )
Some flags are public, some are internal to the parser.

Enumerations

enum EblParserState_t {
EblParserStateInit ,
EblParserStateIdle ,
EblParserStateHeader ,
EblParserStateHeaderV2 ,
EblParserStateBootloader ,
EblParserStateBootloaderData ,
EblParserStateApplication ,
EblParserStateMetadata ,
EblParserStateMetadataData ,
EblParserStateProg ,
EblParserStateProgData ,
EblParserStateSe ,
EblParserStateSeData ,
EblParserStateEraseProg ,
EblParserStateFinalize ,
EblParserStateDone ,
EblParserStateEncryptionInit ,
EblParserStateEncryptionContainer ,
EblParserStateSignature ,
EblParserStateCustomTag ,
EblParserStateError
}
State in the EBL parser state machine.

Functions

int32_t gbl_writeProgData ( ParserContext_t *context, uint8_t buffer[], size_t length, const BootloaderParserCallbacks_t *callbacks)

Enumeration Type Documentation

State in the EBL parser state machine.

Enumerator
EblParserStateInit

Initial state.

EblParserStateIdle

Idle state.

EblParserStateHeader

Parsing header tag.

EblParserStateHeaderV2

Parsing V2 header tag.

EblParserStateBootloader

Parsing bootloader tag.

EblParserStateBootloaderData

Parsing bootloader tag data.

EblParserStateApplication

Parsing application tag.

EblParserStateMetadata

Parsing metadata tag.

EblParserStateMetadataData

Parsing metadata tag data.

EblParserStateProg

Parsing flash program tag.

EblParserStateProgData

Parsing flash program tag data.

EblParserStateSe

Parsing SE tag.

EblParserStateSeData

Parsing SE tag data.

EblParserStateEraseProg

Parsing flash erase&program tag.

EblParserStateFinalize

Finalizing file.

EblParserStateDone

Parsing complete.

EblParserStateEncryptionInit

Parsing encryption init tag.

EblParserStateEncryptionContainer

Parsing encryption data tag.

EblParserStateSignature

Parsing signature tag.

EblParserStateCustomTag

Parsing custom tag.

EblParserStateError

Error state.

Definition at line 56 of file btl_ebl_parser.h .

Function Documentation

int32_t gbl_writeProgData ( ParserContext_t * context,
uint8_t buffer[],
size_t length,
const BootloaderParserCallbacks_t * callbacks
)

Write application data. This function is called when parsing any tag with EblProg_t structured content.

Parameters
context GBL parser context
buffer Input buffer containing data to be written
length Size of input buffer
callbacks GBL Parser callbacks for writing data
Returns
Error code