flash.sh 861 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. OUTPUT_DIR=$1
  3. BOARD_NAME=${2:-stm32f429disc1}
  4. if ! test -d "${OUTPUT_DIR}" ; then
  5. echo "ERROR: no output directory specified."
  6. echo "Usage: $0 OUTPUT_DIR BOARD_NAME"
  7. echo ""
  8. echo "Arguments:"
  9. echo " OUTPUT_DIR The OpenADK output directory."
  10. echo " BOARD_NAME One of the available boards among:"
  11. echo " stm32f429discovery, stm32f429disc1"
  12. exit 1
  13. fi
  14. ./host_x86_64-linux-gnu/usr/bin/openocd -f board/${BOARD_NAME}.cfg \
  15. -c "init" \
  16. -c "reset init" \
  17. -c "flash probe 0" \
  18. -c "flash info 0" \
  19. -c "flash write_image erase ${OUTPUT_DIR}/stm32f429i-disco.bin 0x08000000" \
  20. -c "flash write_image erase ${OUTPUT_DIR}/stm32f429-disco.dtb 0x08004000" \
  21. -c "flash write_image erase ${OUTPUT_DIR}/st-stm32f429-initramfspiggyback-kernel 0x08008000" \
  22. -c "reset run" \
  23. -c "shutdown"