OSDN Git Service

V4.0
[fast-forth/master.git] / config / FET_prog.bat
1 ::@echo off
2
3 set target=%~n1
4 IF EXIST config\Select.bat (
5 :: used by scite commands Ctrl+1 or Ctrl+4
6         call config\Select.bat SelectDevice  %%target%%
7         IF EXIST %~dp1binaries\%~n1.txt (       
8             call %~dp1prog\msp430flasher -s -m SBW2 -u -n %%device%% -v -w %~dp1binaries\%~n1.txt  -z [RESET,VCC]
9         ) else ( 
10 :: hex files generate error 60: verify error 
11             IF EXIST %~dp1binaries\%~n1.hex (
12                 call %~dp1prog\msp430flasher -s -m SBW2 -u -n %%device%% -v -w %~dp1binaries\%~n1.hex  -z [RESET,VCC]
13                 )
14         )
15 ) else (
16     IF EXIST %~dp1..\config\Select.bat (
17 :: used by drag n drop on \binaries\FET_prog.bat
18         call  %~dp1..\config\Select.bat SelectDevice %%target%%
19         IF EXIST %~n1.txt (
20             call %~dp1..\prog\msp430flasher -s -m SBW2 -u -n %%device%% -v -w %~n1.txt  -z [RESET,VCC]
21         ) else (
22 :: hex files generate error 60: verify error 
23             IF EXIST %~n1.hex (
24                 call %~dp1..\prog\msp430flasher -s -m SBW2 -u -n %%device%% -v -w %~n1.hex  -z [RESET,VCC]
25                 )
26         )
27     )
28 )
29 ::pause
30 @exit
31
32 :: %n1 = filename of file to flash
33 :: -s : force update
34 :: -m : select SBW2 mode
35 :: -u : Unlocks locked flash memory (INFOA) for writing.
36 :: -n %device% : device set from %n1
37 :: -v : verify device
38 :: -w %~dpn1.txt : file to be flashed
39 :: -z [] : end of flasher behaviour