From 13ec28b4bd88099c051f87a5ef59a46aa41a740b Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sat, 28 Dec 2019 17:32:05 +1300 Subject: Add script for downloading U-Boot binaries to RAM --- load-u-boot.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 load-u-boot.sh (limited to 'load-u-boot.sh') diff --git a/load-u-boot.sh b/load-u-boot.sh new file mode 100755 index 0000000..6284e8b --- /dev/null +++ b/load-u-boot.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# load-u-boot.sh - a simple script that wraps GDB in order to download a U-Boot +# image from a host computer into a target's RAM over JTAG +# using an OpenOCD GDB server. + +# Parameters/syntax: +# ./load-u-boot.sh [binary [location]] +# * binary: file to download +# * location: memory address on the target to start loading binary to +# * GDB env var controls which GDB to use + +[ -z "$GDB" ] && GDB=armv8l-linux-gnueabihf-gdb +binary=${1:-/tmp/u-boot.bin} +location=${2:-0x8000} + +trap clean EXIT +script=$(mktemp) + +clean(){ + rm -f "$script" +} + +cat > "$script" <