|
trex romok 这指令做何用途??
---
COMMAND ROMOK
ULcl uvfHandle
ULcl uvfSize
ULcl bcount
stack lba
Vscon
FileOpenMod ORdOnly | OBinary
getstr szfilename, "flash.bin"
uvfHandle = FileOpen szfilename
if (FileErrNo != 0)
// File not found
printf "\nflash.bin not found!"
GoTo ALLDONE
else
printf "\n\nLoading flash.bin from File, %s", szFileName
uvfSize= FileSize szfilename
ResizeWbfr uvfSize
FileRead uvfHandle, uvfSize, wbfr
if (FileErrNo == 0)
printf "\nStarting the download"
b=1 //This is 256 blks of data, 128k
rfeat=0
rsecn=1
rsecc=0
rcyll=0
rcylh=0
cmd 0x92
// Init local count
bcount=0
// Xfer data
while(bcount< uvfSize)
WB WBFR:bcount
bcount+=0x200
ewhile
// Wait for busy to clear
waitb
if (rstat bitclr 0)
printf "\nflash.bin loaded : %s",szfilename
printf "\nFlash programming complete."
eif
else
printf "\n File Read Failed. Error No. = 0x%04X",FileErrNo
eif
FileClose uvfHandle // Close file
elseif (FileErrNo == feNOENT)
printf "\n File %s not found.",szfilename
else
printf "\n File Open Failed. Error No. = 0x%04X",FileErrNo
eif
ALLDONE:
printf "\n\nALL Done."
lba stack
rtf
Ecommand |
|