# ____________________________________________________________________________
# 
# Option file
# ===========
# @<Option filename> 
#   Put some or all options into a file <Option filename> 
# ____________________________________________________________________________
# 
# Example:
# ========
#   FL7.EXE /I=MyProg.hex /C=1 /T=5 /P=wr32(ff0054,47),wr32(ff0014,20000) 
#   FL7.EXE /I=MyProg.hex @MyOptions.cfg 
#   FL7.EXE @MyOptions.cfg 
# ____________________________________________________________________________


# ____________________________________________________________________________
# 
# 
# /I=<Hex file>
# -------------
# <Hex file> = Input Intel hex file 

# ____________________________________________________________________________
# /VERIFY=<Hex file>
# ------------------
# Verify Intel-hex file and Flash 
# <Hex file> = Input Intel hex file 
# ____________________________________________________________________________
# 

# ____________________________________________________________________________
# 
# /C=<Comport>
# ------------
# <Comport> = (1,2, .... ) serial com port 

/C=29

# ____________________________________________________________________________
# 
# /B=<Baudrate>
# -------------
# <Baudrate> = (1843200,921600,460800,230400,115200,57600,19200,9600)                        
# ____________________________________________________________________________
# 

/B=230400

# ____________________________________________________________________________
# 
# /F=<BMC frequency>
# ------------------
# <BMC frequency> = (10, 12, 20, 24, or 26)
#  10: BMC Frequency 10.368MHz (default)
#  20: BMC Frequency 20.736MHz
#  12: BMC Frequency 12 MHz
#  24: BMC Frequency 24 MHz
#  26: BMC Frequency 26 MHz
#  OBS:When using freq 12,24,or 26, it requires that the PC COM port can handle
#      non standard baud rates

/F=20

# ____________________________________________________________________________
# 
# /US=<x>
# -------
# Update Sector method
#   x=0 Chip erase (delete all setors) before programming.
#   x=1 Update only sectors containing data.
#   x=3 Same as x=1 but DON'T update Info Block (ONLY:Internal BCM Flash mode)
#   x=4 Patch program code. Update only changed sectors (compare before erase!)
#   x=5 Same as x=4 but DON'T update Info Block (ONLY:Internal BCM Flash mode)
#   x=6 Prerequisite flash already erased:                                    
#       Don't erase flash. We expects that the flash already is erased, so we 
#       don't have to spend time on erase. This can be used in production where 
#       brand new flashs are supposed to be empty.

/US=1


# ____________________________________________________________________________
# 
# /RAM=<x>
# --------
# Write data to RAM sector
# <x> = (0,1) 1: program memory is RAM (default 0: flash) 


# ____________________________________________________________________________
# 
# /DUMP=<x>
# ---------
# Dump data to Dump.bin, after programming
#  <x> = (0,1) 1: dump data (default 0: no dump)


# ____________________________________________________________________________
# 
# /DEBUG=<x>
# ----------
# Debug log generation
#  <x>  
#   0: No log file (default)
#   1: Generate log file (FL7.log) 
#   2: Generate log file with auto naming (FL7<time stamp>.log)
#   4: Raw data log 

/DEBUG=2

# ____________________________________________________________________________
# 
# /BusMon=<x>
# -----------
# Uart monitor during power on - detect boot mode
# <x> = (0,1) 1: Monitor mode on  (default 0: no monitor)

/BusMon=1

# ____________________________________________________________________________
# 
# <Target type> =  : 
#  4: SC14480            
#  5: SC14450  EXT  FLASH
#  6: SC14x41  QSPI FLASH
#  9: SC14452  EXT  FLASH
# 11: SC14MIPS QSPI FLASH
# 12: DA14195  QSPI FLASH
# 13: DA14495  QSPI FLASH
           
/T=13
                    
# ____________________________________________________________________________
# 
# /READ=(<filename>,<start address>,<size>)
# -----------------------------------------
# Read flash 
#  <filename>      = File name (binay file)
#  <start address> = memory start address 
#  <size>          = memory size    (if size=0 => auto detect total size)


# ____________________________________________________________________________
# 
# /RtsBootCtrl=<x>,[<level>]
# -----------
# This option requires a serialport adaptor with Rts boot ctrl HW
#  <x> = 0: RtsBootCtrl Off (default 0)
#        1: RtsBootCtrl On - until user keypress
#        2: RtsBootCtrl On - until user keypress or timeout 2sec 
#        x: RtsBootCtrl On - until user keypress or timeout xsec 
#
#  [<level>]   possible but not compulsory option
#   <level>    not defined (default) => level=1)
#   <level>=1  Set Rts High
#   <level>=0  Set Rts Low


# ____________________________________________________________________________
# 
# /ResetMode=<x>
# -----------
#  Reset mode : How to reset target after programming.
#  <x> = 0: Sw reset  (default 0: Sw Reset)
#        1: Power off
#        2: Jump to start address
#        3: Don't reset - stay in flashloader mode (only for debug)

/ResetMode=1

# ____________________________________________________________________________
# 
# /P=<Register PatchCode> 
# ------------------------
# Patch code to write internal BMC registers before programming
# F.ex: Can be used to configurate Address bus, and chip select in SC14450
#  <Register PatchCode> = 
#     wr32(<address>,<data>)
#     wr16(<address>,<data>)


# ____________________________________________________________________________
# 
# /StartAddress=<x>
# -----------------
# If flash start address is different from start address found in hex file. 
# (No data located at flash start address!)
# Then start address have to be set here! /StartAddress=<x>
# If StartAddress not set, then FL7 will use lowest address found in
# hex file as StartAdress (as default)

# ____________________________________________________________________________
# 
# Option file
# ===========
# @<Option filename> 
#   Put some or all options into a file <Option filename> 
# ____________________________________________________________________________
# 
#   Error code
#   ----------
#   0000  Success
#   0001  Communication with target failed
#   0002  No acknowledge received from target
#   0003  Not able to open serial communication port
#   0004  Writing data to serial port failed
#   0005  Attempt to change baud rate failed
#   0006  Access to serial communnication port fail
#   0007  Serial communnication port already open
#   0008  Attempt to rewrite log file failed
#   0009  The choice og BMC type is unsupported
#   0010  Downloading Flashloader code in target failed - No ACK received!
#   0011  Downloading Flashloader code in target failed - Wrong ACK char received!
#   0012  Downloading Flashloader code in target failed - No Chk char received
#   0013  Downloading Flashloader code in target failed - Wrong chk char received
#   0014  Downloading Flashloader code in target failed - No STX received!
#   0015  No boot mode detected - No STX char received
#   0016  Creating temporary binary file error
#   0017  Opening Intel-hex input file failed
#   0018  Intel-hex file record checksum error detected
#   0019  Buffer overflow reading Intel-hex file
#   0020  Unsupported record in Intel-hex file
#   0021  Unknown record in Intel-hex file
#   0022  Syntax error in Intel-hex file
#   0023  Access to temporary binary file failed
#   0024  Buffer overflow reading Intel-hex file
#   0025  Allocating buffer for binary data failed
#   0026  Allocating buffer for binary inuse array failed
#   0027  Reading Intel-hex file error
#   0028  Reading Intel-hex file size error
#   0029  CFI query identification string error - Reading flash CFI failed
#   0030  Flash start address, out of range (not inside flash area)
#   0031  CFI blocksize = 0 
#   0032  Allocate Sector info record error
#   0033  Unsupported flash type
#   0034  CRC32 Data error
#   0035  Waiting for bit change in Flash control register timeout
#   0036  Creating binary file for read back data failed
#   0037  Unknown external flash type
#   0038  Unable to create thread
#   0039  Error during thread startup
#   0040  ProgramOptionMutex timeout
#   0041  Allocation of memory error
#   0042  Unsupport frequency
#   0043  Unsupport target frequency combination
#   0044  Unsupport target reset command
#   0045  Downloading Flashloader code in target failed - Preloader failed!
#   0046  Downloading Flashloader code in target failed - Preloader crc error!
#   0047  PATCH_ERASE_METHOD not supported for this flash type (not uniform sector size)
#   0048  This type is not supported anymore
# ____________________________________________________________________________
# 
#   Command-line arguments error code
#   ---------------------------------
#   1000  No arguments
#   1001  Error in arguments
#   1002  COM port undefined /C=??
#   1003  Input file missing /I=??
#   1004  Can't open serial COM port
#   1005  Can't open serial COM port
#   1006  Terminated by user
# ____________________________________________________________________________
# 