echo %date% %time% starting LCU convert >> C:\INSTALL.log

set load_directory=released

set broadtype=lcu

set type=lcu_rov_su

IF EXIST sys.hex del sys.hex
IF EXIST sec1.bin del sec1.bin
IF EXIST sec1.enc del sec1.enc
IF EXIST boot.hex del boot.hex
IF EXIST boot.bin del boot.bin
IF EXIST boot.enc del boot.enc
IF EXIST fpga.bin del fpga.bin
IF EXIST fpga.bsd del fpga.bsd

copy xc2v500.bsd fpga.bsd

copy %load_directory%\%type%\boot\*.hex boot.hex

copy %load_directory%\%type%\sys\*.hex sys.hex

copy /B %load_directory%\%type%\fpga\*.bin fpga.bin 

boot_noFPGA boot.hex boot.bin

flashenc_ldsect 0x20 0x10 0 512 50000 100 boot.bin boot.enc

Flash_3sectors_XC2V500 sys.hex fpga.bin sec1.bin

flashenc_ldsect 0x20 0x10 1 512 300000 100 sec1.bin sec1.enc

cls

lmtest halt_all.enc

sleep 1

lmtest halt_all.enc

sleep 1

echo sending sec 1

lmtest sec1.enc

sleep 0.1

echo new sector 1 has been sent, now sending new boot.enc

sleep 1

lmtest boot.enc

IF EXIST sys.hex del sys.hex
IF EXIST sec1.bin del sec1.bin
IF EXIST sec1.enc del sec1.enc
IF EXIST boot.hex del boot.hex
IF EXIST boot.bin del boot.bin
IF EXIST boot.enc del boot.enc
IF EXIST fpga.bin del fpga.bin
IF EXIST fpga.bsd del fpga.bsd

echo %date% %time% Completed LCU convert >> C:\INSTALL.log
echo new boot and sec1 sent, recycle power

sleep 1