diff options
Diffstat (limited to 'launch-openocd')
-rwxr-xr-x | launch-openocd | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/launch-openocd b/launch-openocd new file mode 100755 index 0000000..18b30b2 --- /dev/null +++ b/launch-openocd @@ -0,0 +1,16 @@ +#!/bin/sh + +stlinkv2=$(lsusb -d 0483:374b | wc -l) +olimex=$(lsusb -d 15ba:002a | wc -l) + +DEVICE= +if [ $stlinkv2 -gt 0 ] +then + DEVICE=stlinkv2 +elif [ $olimex -gt 0 ] +then + DEVICE=olimex-arm-usb-tiny-h +fi + +export DEVICE +exec openocd -f openocd.cfg |