summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbrodkorb@infonline.de>2021-04-09 21:33:51 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2021-04-15 12:22:04 +0200
commit057de2b771709291308b7c2217707a35fdf54c9f (patch)
tree853193053429b3343507e077a02164935e73840b /scripts
parentcc2191d76da8bb84bd4f52727b24a6b5bd94ec6b (diff)
stm32 fixes
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/flash.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/flash.sh b/scripts/flash.sh
new file mode 100755
index 000000000..3763cb7af
--- /dev/null
+++ b/scripts/flash.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+OUTPUT_DIR=$1
+BOARD_NAME=${2:-stm32f429disc1}
+
+if ! test -d "${OUTPUT_DIR}" ; then
+ echo "ERROR: no output directory specified."
+ echo "Usage: $0 OUTPUT_DIR BOARD_NAME"
+ echo ""
+ echo "Arguments:"
+ echo " OUTPUT_DIR The Buildroot output directory."
+ echo " BOARD_NAME One of the available boards among:"
+ echo " stm32f429discovery, stm32f429disc1"
+ exit 1
+fi
+
+./host_x86_64-linux-gnu/usr/bin/openocd -f board/${BOARD_NAME}.cfg \
+ -c "init" \
+ -c "reset init" \
+ -c "flash probe 0" \
+ -c "flash info 0" \
+ -c "flash write_image erase ${OUTPUT_DIR}/stm32f429i-disco.bin 0x08000000" \
+ -c "flash write_image erase ${OUTPUT_DIR}/stm32f429-disco.dtb 0x08004000" \
+ -c "flash write_image erase ${OUTPUT_DIR}/st-stm32f429-initramfspiggyback-kernel 0x08008000" \
+ -c "reset run" \
+ -c "shutdown"