@echo off % Hide command output %
color FF % Set console color %
title=F1C100S/F1C200S Firmware Flasher

echo Initializing flash process...

cd\ % Return to root directory %
cd "%~dp0sunxi-tools"
echo Programming tool path: %~dp0sunxi-tools
echo Firmware directory: %~dp0

echo Writing firmware...
sunxi-fel -p spiflash-write 0x0 "%~dp0.\firmware\boot0.bin"
sunxi-fel -p spiflash-write 0x6000 "%~dp0.\firmware\LOGO_SMSL.bin"
sunxi-fel -p spiflash-write 0x50000 "%~dp0.\firmware\SMSL H400_Soc_V2.02.bin"
echo Firmware write completed

TIMEOUT /T 2 % Pause before exit %