forked from TiejunMS/nf-interpreter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
startocd.bat
48 lines (35 loc) · 1.4 KB
/
startocd.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
REM Starts OpenOCD - designed to be called from GDB, itself started from Visual Studio launch.vs.json
REM If already running it will fail and exit, leaving the existing one to handle GDB requests
REM Template allows for multiple target interfaces and boards - add new ones as required
REM DAV 26FEB19
setlocal
set cmd=C:/nf/ESP32/openocd-esp32/bin/openocd.exe -s C:/nf/ESP32/openocd-esp32/share/openocd/scripts
if %1.==. goto ESP32_JLINK
call :%1
if %errorlevel% equ 1 goto :lblerror
goto end
REM Start OpenOCD
:start
start %cmd% %iface%
goto :eof
:end
endlocal
exit
:lblerror
mshta javascript:alert("Error: Unknown label %1");close();
goto end
REM Add additional interface/board combinations here, and add the label to the launch.vs.json file
:ESP32_JLINK
set iface=-f interface/jlink.cfg -f target/esp32.cfg -c "adapter_khz 3000"
goto start
:ESP32_OLIMEX
set iface=-f interface/ftdi/olimex-arm-usb-ocd-h.cfg -f target/esp32.cfg -c "adapter_khz 3000"
goto start
:ESP32_WROVER
set iface=-f interface/ftdi/esp32_devkitj_v1.cfg -f board/esp32-wrover.cfg
goto start
:STM32_STLINK
REM Note: I tried using the Eclipse OpenOCD without much success here, then switched to the ESP32 version, and it works right out of the box!
REM set cmd=C:/nanoFramework_Tools/Tools/openocd/bin/openocd.exe -s C:/nanoFramework_Tools/Tools/openocd/bin/scripts
set iface=-f interface/stlink-v2-1.cfg -f board/stm32f7discovery.cfg
goto start