From c0b40ef8624e598560cdd104c5549ab562ecd01a Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Tue, 28 Dec 2021 18:58:14 +0800 Subject: [PATCH] update win_flash.bat --- bsp/images/wintools/win_flash.bat | 49 +++++++++++++++++++++++++++++++++++++++---------- 1 files changed, 39 insertions(+), 10 deletions(-) diff --git a/bsp/images/wintools/win_flash.bat b/bsp/images/wintools/win_flash.bat index a93b8be..710b5d6 100644 --- a/bsp/images/wintools/win_flash.bat +++ b/bsp/images/wintools/win_flash.bat @@ -1,4 +1,3 @@ - REM This bat script used to flash u-boot or linux system image to EMMC REM uuu.exe official address: https://github.com/NXPmicro/mfgtools @@ -9,18 +8,48 @@ @echo off -set BOARD=igkboard -set ROOTFS=buildroot +REM Boot media should be emmc or sd +set Media=emmc -set IMAGE_UBOOT=u-boot-%BOARD%-emmc.imx -set IMAGE_SYS=linuxsys_%BOARD%_%ROOTFS%.img +setlocal enabledelayedexpansion +set /a i=0 -echo "Image Download Choices:" +echo Image Download Choices: +echo. -echo 1: Download bootloader [ %IMAGE_UBOOT% ] -echo 2: Download System Image [ %IMAGE_SYS% ] +REM Scan u-boot file +for %%f in (*.imx) do ( + SET /a i+=1 + echo [!i!]: %%f + set ImgArr[!i!]=%%f + set ImgUboot=%%f +) +REM Scan all the system image files +for %%f in (*.img,*.wic) do ( + SET /a i+=1 + echo [!i!]: %%f + set ImgArr[!i!]=%%f +) + +if "%ImgUboot%" == "" ( + echo ERROR: U-boot image not found! + pause + exit; +) + +echo. set /p choice= Please Input Your Choice: +call set image=%%ImgArr[%choice%]%% +echo. -if %choice% == 1 uuu -b emmc %IMAGE_UBOOT% -if %choice% == 2 uuu -b emmc_all %IMAGE_UBOOT% %IMAGE_SYS% +echo %image% | findstr /i "u-boot" > nul +if %errorlevel% equ 0 ( + echo Start burn u-boot image: "%image%" + echo. + uuu -b %Media% %ImgUboot% +) else ( + echo Start burn system image: "%image%" + echo. + uuu -b %Media%_all %ImgUboot% %image% +) -- Gitblit v1.9.1