F29H85x-SDK  1.03.00.00
 
APIs for Uart Flash Programmer

Introduction

Files

file  CommandLine.h
 Includes the command line utility functions to parse all command parameters.
 
file  Common.h
 Commonly shared libraries, macros and global variables.
 
file  FlashStatus.h
 Utility file to interpret Flash Status Packet Info (FlashStatusPkt_t)
 
file  OutputStream.h
 Includes output stream abstract class based on std::ostream.
 
file  PacketParser.h
 Includes the general function and strcture used in packet communication protocol.
 
file  SoCIDParser.h
 Interprets SocID info.
 
file  UartDownload.h
 Includes the abstracted UART download flows and its associated sub-functions.
 
file  UartInterface.h
 Includes low-level abstraction interface function to UART serial port.
 
file  UartPacket.h
 Includes High-level UART packet flow implementation.
 
file  CommandLine.cpp
 Command line prints, error checks and parameter parsing functions.
 
file  FlashStatus.cpp
 Utility file to interpret Flash Status Packet Info (FlashStatusPkt_t)
 
file  PacketParser.cpp
 Includes the general function and strcture used in packet communication protocol.
 
file  SoCIDParser.cpp
 Interprets SOCID_Info.
 
file  UartDownload.cpp
 High-level UART workflow (download host image to target)
 
file  UartInterface.cpp
 Low-level abstraction interface to UART serial port read and write.
 
file  UartPacket.cpp
 Includes High-level UART packet flow implementation.
 

Data Structures

class  CoutStream
 
class  NullStream
 
class  FileStream
 

Functions

void parseCommandLine (int argc, char *argv[])
 
void exitApp (int iRetcode)
 
int printFlashStatus (std::ostream &console, FlashStatusPkt_t &flashPkt)
 Prints the Flash Status Packet Info (FlashStatusPkt_t) to the console.
 
int printSocID (std::ostream &console, void *data, size_t length)
 Prints the SoC ID Info to the provided console.
 
int printBromStatus (std::ostream &console, void *data, size_t length)
 Prints the Brom Status Info to the provided console.
 
int downloadBootloader (FlashProgrammer::UartInterface &uartHandle, const char *kernelFile)
 Download a (SBL) kernel to the device via BootROM.
 
int downloadApplication (FlashProgrammer::UartInterface &uartHandle, const char *applicationFile, const size_t maxPacketSize)
 Download an application image with certificate to the device.
 
void printVersion (void)
 
void printWelcome (void)
 
void showHelp (void)
 
void setDeviceName (const char *deviceName)
 
void setInputOptions (const char *optionList)
 
void checkErrors (void)
 
int _printFMSTAT_f29h85x (std::ostream &console, FlashStatusPkt_t &flashPkt)
 
int _printSocId_f29h85x (std::ostream &console, void *data, size_t length)
 
int _printbromStatus_f29h85x (std::ostream &console, void *data, size_t length)
 
void convertEndian (void *data, std::size_t byteSize)
 
int _UartBoot (FlashProgrammer::UartInterface &uartHandle, FILE *fptr)
 Loads the program to device by sending the file to BootROM/flash kernel via the boot ROM method (byte-by-byte send with byte-by-byte acknowledgement) Note: This is the default behavior from BootROM for uart boot.
 
int _PktDataMode (FlashProgrammer::UartInterface &uartHandle, FILE *fptr)
 Loads the program to device by sending the file to BootROM/flash kernel via the buffered method (frame-by-frame send with frame acknowledgement) Note: This flow has error-detection and error-handling support and therefore recommended for all kernel applications.
 

Namespaces

namespace  FlashProgrammer
 

Macros

#define FLASH_PROGRAMMER_VERSION   2.1.0
 
#define ENABLE_PERIPHERAL_BOOT
 
#define DEFAULT_PAYLOAD_SIZE   512U
 

Macro Definition Documentation

◆ FLASH_PROGRAMMER_VERSION

#define FLASH_PROGRAMMER_VERSION   2.1.0

◆ ENABLE_PERIPHERAL_BOOT

#define ENABLE_PERIPHERAL_BOOT

◆ DEFAULT_PAYLOAD_SIZE

#define DEFAULT_PAYLOAD_SIZE   512U

Function Documentation

◆ parseCommandLine()

void parseCommandLine ( int argc,
char * argv[] )

◆ exitApp()

void exitApp ( int iRetcode)

◆ printFlashStatus()

int printFlashStatus ( std::ostream & console,
FlashStatusPkt_t & flashPkt )

Prints the Flash Status Packet Info (FlashStatusPkt_t) to the console.

Parameters
consoleThe output stream to print the Flash Status Packet Info
flashPktThe Flash Status Packet Info to be printed
Returns
0 upon success, -1 if error occurs

◆ printSocID()

int printSocID ( std::ostream & console,
void * data,
size_t length )

Prints the SoC ID Info to the provided console.

Parameters
consoleThe output stream to print the SoC ID Info
dataPointer to the data containing SoC ID information
lengthThe length of the data to be printed
Returns
0 upon success, -1 if error occurs

◆ printBromStatus()

int printBromStatus ( std::ostream & console,
void * data,
size_t length )

Prints the Brom Status Info to the provided console.

Parameters
consoleThe output stream to print the Brom Status Info
dataPointer to the data containing Brom Status information
lengthThe length of the data to be printed
Returns
0 upon success, -1 if error occurs

◆ downloadBootloader()

int downloadBootloader ( FlashProgrammer::UartInterface & uartHandle,
const char * kernelFile )

Download a (SBL) kernel to the device via BootROM.

Parameters
uartHandleHandle to an instance of UART interface
kernelFileThe name of the kernel file
Returns
0 upon success, -1 if error occurs

◆ downloadApplication()

int downloadApplication ( FlashProgrammer::UartInterface & uartHandle,
const char * applicationFile,
const size_t maxPacketSize )

Download an application image with certificate to the device.

Parameters
uartHandleHandle to an instance of UART interface
applicationFileThe name of the application image
maxPacketSizeOptional packet size input to limit to maximum size of allowable bytes
Returns
0 upon success, -1 if error occurs

◆ printVersion()

void printVersion ( void )

◆ printWelcome()

void printWelcome ( void )

◆ showHelp()

void showHelp ( void )

◆ setDeviceName()

void setDeviceName ( const char * deviceName)

◆ setInputOptions()

void setInputOptions ( const char * optionList)

◆ checkErrors()

void checkErrors ( void )

◆ _printFMSTAT_f29h85x()

int _printFMSTAT_f29h85x ( std::ostream & console,
FlashStatusPkt_t & flashPkt )

◆ _printSocId_f29h85x()

int _printSocId_f29h85x ( std::ostream & console,
void * data,
size_t length )

◆ _printbromStatus_f29h85x()

int _printbromStatus_f29h85x ( std::ostream & console,
void * data,
size_t length )

◆ convertEndian()

void convertEndian ( void * data,
std::size_t byteSize )

◆ _UartBoot()

int _UartBoot ( FlashProgrammer::UartInterface & uartHandle,
FILE * fptr )

Loads the program to device by sending the file to BootROM/flash kernel via the boot ROM method (byte-by-byte send with byte-by-byte acknowledgement) Note: This is the default behavior from BootROM for uart boot.

Parameters
uartHandleHandle to an instance of UART interface
fptrFile handler pointer
Returns
0 upon success, -1 if error occurs

◆ _PktDataMode()

int _PktDataMode ( FlashProgrammer::UartInterface & uartHandle,
FILE * fptr )

Loads the program to device by sending the file to BootROM/flash kernel via the buffered method (frame-by-frame send with frame acknowledgement) Note: This flow has error-detection and error-handling support and therefore recommended for all kernel applications.

Parameters
uartHandleHandle to an instance of UART interface
fptrFile handler pointer
Returns
0 upon success, -1 if error occurs

Variable Documentation

◆ g_pszAppLoadAddress

char* g_pszAppLoadAddress
extern

◆ g_pszAppEntryAddress

char* g_pszAppEntryAddress
extern

◆ g_pszKernelFile

char* g_pszKernelFile
extern

◆ g_pszCPU1AppFile

char* g_pszCPU1AppFile
extern

◆ g_pszCPU3AppFile

char* g_pszCPU3AppFile
extern

◆ g_pszSecCfgProgramFile

char* g_pszSecCfgProgramFile
extern

◆ g_pszHSMFlashCodeProvisionFile

char* g_pszHSMFlashCodeProvisionFile
extern

◆ g_pszCPU1FlashCodeProvisionFile

char* g_pszCPU1FlashCodeProvisionFile
extern

◆ g_pszCPU3FlashCodeProvisionFile

char* g_pszCPU3FlashCodeProvisionFile
extern

◆ g_pszHSMRunTimeFile

char* g_pszHSMRunTimeFile
extern

◆ g_pszHSMKeysFile

char* g_pszHSMKeysFile
extern

◆ g_pszAltTargetBaudRate

char* g_pszAltTargetBaudRate
extern

◆ g_pszAltHostBaudRate

char* g_pszAltHostBaudRate
extern

◆ g_pszComPort

char* g_pszComPort
extern

◆ g_pszDeviceName

char* g_pszDeviceName
extern

◆ g_pszLogFile

char* g_pszLogFile
extern

◆ g_bShownHelp

bool g_bShownHelp
extern

◆ g_bWaitOnExit

bool g_bWaitOnExit
extern

◆ g_bUsrCommand

bool g_bUsrCommand
extern

◆ g_bBootOnly

bool g_bBootOnly
extern

◆ g_usrInputOptions

std::queue<size_t> g_usrInputOptions
extern

◆ g_bf29h85x

bool g_bf29h85x
extern

◆ g_bf29p58x

bool g_bf29p58x
extern

◆ g_bf29p32x

bool g_bf29p32x
extern

◆ g_pOutputStream

std::unique_ptr<std::ostream, void(*)(std::ostream*)> g_pOutputStream
extern