forked from micro-ROS/micro_ros_setup
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset.sh
More file actions
executable file
·32 lines (25 loc) · 793 Bytes
/
reset.sh
File metadata and controls
executable file
·32 lines (25 loc) · 793 Bytes
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
#! /bin/bash
set -e
set -o nounset
set -o pipefail
pushd $FW_TARGETDIR/NuttX > /dev/null
if [ "$PLATFORM" = "olimex-stm32-e407" ]; then
echo "Resetting firmware for $RTOS platform $PLATFORM"
if lsusb -d 15BA:002a; then
PROGRAMMER=interface/ftdi/olimex-arm-usb-tiny-h.cfg
elif lsusb -d 15BA:0003;then
PROGRAMMER=interface/ftdi/olimex-arm-usb-ocd.cfg
elif lsusb -d 15BA:002b;then
PROGRAMMER=interface/ftdi/olimex-arm-usb-ocd-h.cfg
elif lsusb -d 0483:3748;then
PROGRAMMER=interface/stlink-v2.cfg
else
echo "Error. Unsuported OpenOCD USB programmer"
exit 1
fi
openocd -f $PROGRAMMER -f target/stm32f4x.cfg -c init -c "reset halt" -c "reset" -c "exit"
else
echo "Unrecognized board: $PLATFORM"
exit 1
fi
popd > /dev/null