summaryrefslogtreecommitdiff
path: root/scripts/flash-uboot.sh
blob: e0cfcb340d678b71c75ce7f962c62723998868eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

OUTPUT_DIR=$1

if ! test -d "${OUTPUT_DIR}" ; then
    echo "ERROR: no output directory specified."
    echo "Usage: $0 OUTPUT_DIR"
    echo ""
    echo "Arguments:"
    echo "    OUTPUT_DIR    The OpenADK output directory."
    exit 1
fi

./host_x86_64-linux-gnu/usr/bin/openocd \
	-f interface/stlink.cfg -f board/stm32f7discovery.cfg \
-c "init" \
-c "reset init" \
-c "flash probe 0" \
-c "flash info 0" \
-c "flash write_image erase ${OUTPUT_DIR}/u-boot-spl.bin 0x08000000" \
-c "flash write_image erase ${OUTPUT_DIR}/u-boot-dtb.bin 0x08008000" \
-c "reset run" \
-c "shutdown"