#!/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" <