@echo off

echo.
echo !!! WARNING: This will program the CircleOS into the STM3242x-EvoPrimer. !!!
echo !!!        All applications currently loaded will be erased.             !!!
echo.
echo Press Ctrl-C to abort.

pause

echo.
Cortex_pgm TSTM32F429xI E PEvo_Circle_STM3242x.hex S

if errorlevel 1 goto error_handler

goto end

:error_handler
echo.
echo.
echo !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo.
echo STM3242x-EvoPrimer programmation failed. Please check that the "Debug" USB connector
echo   is plugged and that the STM3242x-EvoPrimer is powered up.
echo (press the STM3242x-EvoPrimer button if you are unsure)

:end
echo.
pause
