1 @echo off
2 setlocal
4 set binpath=%~dp0\..\build
6 if "%1"=="" (
7 echo usage: %~nx0 binary [[com_port_id] [energia_install_dir]]
8 exit /b 1
9 )
11 set bin=%1
12 if not exist %1 (
13 if exist %binpath%\%1 (
14 set bin=%binpath%\%1
15 ) else (
16 echo error: can't find the binary file "%1"
17 exit /b 1
18 )
19 )
21 set comid=%2
22 if "%2"=="" (
23 set comid=9
24 )
26 if "%3"=="" (
27 set eidir=C:\ti
28 ) else (
29 set eidir=%3
30 )
32 for /f "usebackq delims=" %%f in (`dir /b /o:n %eidir%\energia-*`) do (
33 REM cc3200prog must also be run from it's home directory (!)
34 echo chdir %eidir%\%%f\hardware\tools\lm4f\bin
35 chdir %eidir%\%%f\hardware\tools\lm4f\bin
37 echo cc3200prog %comid% %bin%
38 cc3200prog %comid% %bin% || exit /b 1
39 echo Upload succeeded.
40 echo Push the reset button on the ZumoCC3200 to start the sketch.
41 exit /b 0
42 )
44 echo error: energia is not installed in %eidir%
45 exit /b 1