C# Class DVFlasher.Program

Main program Class
Show file Open project: neuros/ti-uart-boot

Public Properties

Property Type Description
MySP System.IO.Ports.SerialPort
cmdParams ProgramCmdParams
cmdString String
workerThread Thread
workerThreadSucceeded System.Boolean

Public Methods

Method Description
ParseCmdLine ( String args ) : ProgramCmdParams

Parse the command line into the appropriate internal command structure

WorkerThreadStart ( ) : void

The main fucntion of the thread where all the cool stuff happens to interface with the DVEVM

bin2srec ( Stream inputStream, UInt32 startAddr ) : Byte[]

Function to convert the input filestream into an byte array in S-record format, so that it can be downloaded to the EVM board.

isFileSrec ( FileStream inputFileStream ) : System.Boolean

Check to see if filestream is an S-record by reading the first character of each line and seeing if it is 'S'

readSrec ( FileStream inputFileStream ) : Byte[]

Get the byte array if the file is already an S-record

Private Methods

Method Description
DispHelp ( ) : void

Help Display Function

GetEmbeddedUBLStream ( ) : Stream

Read the appropriate embedded UBL data (NAND or NOR) that will be transmitted to the DM644x.

GetFileData ( String filename, UInt32 decAddr ) : Byte[]

Function to find, read, and convert to S-record (if needed) a data file

Main ( String args ) : Int32

Main entry point of application

TransmitAPP ( ) : void

Function to transmit the application code via the UBL, which is now running on the DM644x. This code is specific to the TI supplied UBL. If the the TI supplied UBL is modified or a different boot loader is used, this code will need to be modified.

TransmitCMDSuccessful ( ) : System.Boolean

Function to transmit the CMD and command over the UART (following BOOTPSP)

TransmitErase ( ) : void

Send command and wait for erase response. (NOR and NAND global erase)

TransmitFLASHUBLandAPP ( ) : void

Function to transmit the second UBL if it is needed

TransmitUARTUBL ( ) : void

Function to Transmit the UBL via the DM644x ROM Serial boot

waitForSequence ( String str, String altStr, SerialPort sp ) : System.Boolean

Wait for null-terminated sequences from supplied serial port

waitForSequence ( String str, String altStr, SerialPort sp, System.Boolean verbose ) : System.Boolean

Waitforsequence with option for verbosity

Method Details

ParseCmdLine() public static method

Parse the command line into the appropriate internal command structure
public static ParseCmdLine ( String args ) : ProgramCmdParams
args String The array of strings passed to the command line.
return ProgramCmdParams

WorkerThreadStart() public static method

The main fucntion of the thread where all the cool stuff happens to interface with the DVEVM
public static WorkerThreadStart ( ) : void
return void

bin2srec() public static method

Function to convert the input filestream into an byte array in S-record format, so that it can be downloaded to the EVM board.
public static bin2srec ( Stream inputStream, UInt32 startAddr ) : Byte[]
inputStream Stream
startAddr System.UInt32 The starting address of the RAM location where the binary data /// encapsulated by the S-record will be stored.
return Byte[]

isFileSrec() public static method

Check to see if filestream is an S-record by reading the first character of each line and seeing if it is 'S'
public static isFileSrec ( FileStream inputFileStream ) : System.Boolean
inputFileStream System.IO.FileStream The input filestream that encapsulates the /// input application file.
return System.Boolean

readSrec() public static method

Get the byte array if the file is already an S-record
public static readSrec ( FileStream inputFileStream ) : Byte[]
inputFileStream System.IO.FileStream The input filestream that encapsulates the /// input application file.
return Byte[]

Property Details

MySP public static property

Global main Serial Port Object
public static SerialPort,System.IO.Ports MySP
return System.IO.Ports.SerialPort

cmdParams public static property

Public variable to hold needed command line and program parameters
public static ProgramCmdParams,DVFlasher cmdParams
return ProgramCmdParams

cmdString public static property

String to hold the summary of operation program will attempt.
public static String cmdString
return String

workerThread public static property

The main thread used to actually execute everything
public static Thread workerThread
return Thread

workerThreadSucceeded public static property

Global boolean to indicate successful completion of workerThread
public static Boolean,System workerThreadSucceeded
return System.Boolean