2
1

flash_sd.sh 485 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. if [ $# -eq 0 ]; then
  3. OUTPUT_DIR=output
  4. else
  5. OUTPUT_DIR=$1
  6. fi
  7. if ! test -d "${OUTPUT_DIR}" ; then
  8. echo "ERROR: no output directory specified."
  9. echo "Usage: $0 OUTPUT_DIR"
  10. exit 1
  11. fi
  12. "${OUTPUT_DIR}"/host/bin/openocd -f board/stm32f746g-disco.cfg \
  13. -c "init" \
  14. -c "reset init" \
  15. -c "flash probe 0" \
  16. -c "flash info 0" \
  17. -c "flash write_image erase ${OUTPUT_DIR}/images/u-boot.bin 0x08000000" \
  18. -c "reset run" \
  19. -c "shutdown"