Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

flash.sh using mktemp and cat for create scrtip file

  • Loading branch information...
commit cf96f822569a5acad56ac37336ca186f75fc9080 1 parent 21c418b
Xiangfu Liu authored
Showing with 20 additions and 24 deletions.
  1. +20 −24 flash/flash.sh
44 flash/flash.sh
View
@@ -2,36 +2,32 @@
set -e
-TARGET=flickernoise.fbiz
-if [ "$2" == "nocompress" ]; then
- TARGET=flickernoise.fbi
-fi
-
-make -C ../src bin/${TARGET}
-
-BATCH_FILE=flash.batch
-
ADDRESS=0x920000
if [ "$1" == "rescue" ]; then
ADDRESS=0x2E0000
fi
-batch() {
- echo -e "$1" >> "${BATCH_FILE}"
-}
+TARGET=flickernoise.fbiz
+if [ "$2" == "nocompress" ]; then
+ TARGET=flickernoise.fbi
+fi
-rm -rf ${BATCH_FILE}
+make -C ../src bin/${TARGET}
-batch "cable milkymist"
-batch "detect"
-batch "instruction CFG_OUT 000100 BYPASS"
-batch "instruction CFG_IN 000101 BYPASS"
-batch "pld load fjmem.bit"
-batch "initbus fjmem opcode=000010"
-batch "frequency 6000000"
-batch "detectflash 0"
-batch "endian big"
-batch "flashmem ${ADDRESS} ../src/bin/${TARGET} noverify"
-batch "pld reconfigure"
+BATCH_FILE=`mktemp`
+cat > ${BATCH_FILE}<<EOF
+cable milkymist
+detect
+instruction CFG_OUT 000100 BYPASS
+instruction CFG_IN 000101 BYPASS
+pld load fjmem.bit
+initbus fjmem opcode=000010
+frequency 6000000
+detectflash 0
+endian big
+flashmem ${ADDRESS} ../src/bin/${TARGET} noverify
+pld reconfigure
+EOF
jtag -n ${BATCH_FILE}
+rm -f ${BATCH_FILE}
Please sign in to comment.
Something went wrong with that request. Please try again.