1#! /bin/bash
2#
3# SPDX-License-Identifier: Apache-2.0
4
5source $(dirname $0)/../target.sh
6
7lscript=/tmp/flash$$.jlink
8
9cat >$lscript <<EOF
10h
11r
12loadfile outdir/$BOARD/zephyr.bin $BASE_BOOT
13loadfile hello.signed.bin $BASE_PRIMARY_SLOT
14loadfile shell.signed.bin $BASE_SECONDARY_SLOT
15q
16EOF
17
18JLinkExe -device $SOC -si SWD -speed auto \
19	-CommanderScript $lscript
20rm $lscript
21