@echo off rem ============================================================ rem make_package.bat - build bootloader + APP, then merge into rem one flash package (tools/out/caiic_full.*) rem Run from anywhere: tools\make_package.bat rem ============================================================ setlocal set ROOT=%~dp0.. set UV4="D:\Keil_v5\UV4\UV4.exe" echo [1/3] Building bootloader... %UV4% -r "%ROOT%\Boot\MDK-ARM\caiic_boot.uvprojx" -j0 -o "%ROOT%\Boot\MDK-ARM\build.log" if errorlevel 1 goto :fail findstr /C:"0 Error(s), 0 Warning(s)" "%ROOT%\Boot\MDK-ARM\build.log" >nul || goto :fail echo [2/3] Building APP... %UV4% -r "%ROOT%\mcm-ddc-04\MDK-ARM\embeddedSrc.uvprojx" -j0 -o "%ROOT%\mcm-ddc-04\MDK-ARM\build.log" if errorlevel 1 goto :fail findstr /C:"0 Error(s), 0 Warning(s)" "%ROOT%\mcm-ddc-04\MDK-ARM\build.log" >nul || goto :fail echo [3/3] Merging images... set PYEXE= python --version >nul 2>&1 && set PYEXE=python if not defined PYEXE ( if exist "%LOCALAPPDATA%\Programs\Python\Python312\python.exe" ( set PYEXE="%LOCALAPPDATA%\Programs\Python\Python312\python.exe" ) ) if not defined PYEXE ( echo python not found - install Python 3 or fix PATH goto :fail ) %PYEXE% "%~dp0merge_image.py" || goto :fail echo. echo Package ready: tools\out\caiic_full.hex / caiic_full.bin goto :eof :fail echo. echo *** FAILED - check the build logs *** exit /b 1