1#!/bin/bash 2 3OUTPUT_DIR=$1 4 5if ! test -d "${OUTPUT_DIR}"; then 6 echo "ERROR: no output directory specified." 7 echo "Usage: $0 OUTPUT_DIR" 8 exit 1 9fi 10 11${OUTPUT_DIR}/host/bin/openocd -f board/stm32f469discovery.cfg \ 12 -c "init" \ 13 -c "reset init" \ 14 -c "flash probe 0" \ 15 -c "flash info 0" \ 16 -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469i-disco.bin 0x08000000" \ 17 -c "flash write_image erase ${OUTPUT_DIR}/images/stm32f469-disco.dtb 0x08004000" \ 18 -c "flash write_image erase ${OUTPUT_DIR}/images/xipImage 0x08010000" \ 19 -c "reset run" \ 20 -c "shutdown" 21