@echo off rem ============================================================ rem flash_package.bat [image] - erase the chip and program the rem merged package via NS-LINK (NSpyocd); thin wrapper over rem flash_package.py (streams output with the CAIIC banner). rem [image] optional, default: tools\out\mothercup_ble_prod.hex rem Connect NS-LINK to SWD (PA4/PA5) and the reset pin first, rem and CLOSE Keil (it holds the probe). rem ============================================================ setlocal 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 exit /b 1 ) %PYEXE% "%~dp0flash_package.py" %* exit /b %ERRORLEVEL%