trex romok 这指令做何用途??
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 trex romok 这指令做何用途??
code ,看起来很美,用起来呢,没用过TREX 就是回写flash,前提是你之前备份过flash并以文件名flash.bin放在当前目录下 thanks for sharing
页:
[1]