summaryrefslogtreecommitdiff
path: root/launch-openocd
blob: 18b30b29d1d6d468343543eb20872de145007c1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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