1#!/bin/sh2# From https://github.com/sifive/freedom-e-sdk/blob/c07ac84cbdd678963c4dc3ea34a68c47a8b53651/scripts/upload3#4# Copyright (c) 2019 SiFive, Inc.5# Licensed under Apache2 and MIT licenses.67set -e89ELF_FILE=./zig-out/bin/main10export GDB_PORT=33331112openocd -f openocd.cfg &1314gdb-multiarch $ELF_FILE --batch -ex "set remotetimeout 240" \15 -ex "target extended-remote localhost:${GDB_PORT}" \16 -ex "monitor reset halt" \17 -ex "monitor flash protect 0 64 last off" \18 -ex "thread apply all set \$pc=_enter" \19 -ex "load" \20 -ex "monitor resume" \21 -ex "monitor shutdown" -ex "quit"