kopia lustrzana https://github.com/SP8EBC/ParaTNC
bash scripts to downloading and uploading events area
rodzic
e21fc6fea3
commit
1d53d545e8
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
|
||||
DATE=$(date +%Y%m%d)
|
||||
TIME=$(date +%H%M%S)
|
||||
|
||||
FILENAME=events_$DATE-$TIME
|
||||
|
||||
if [ ! -d "./parameteo-events" ]; then
|
||||
mkdir "./parameteo-events"
|
||||
fi
|
||||
|
||||
echo "dumping to Intel-HEX file ./parameteo-events/$FILENAME.hex"
|
||||
st-flash --debug --format ihex read ./parameteo-events/$FILENAME.hex 0x0805A800 0x22800 > ./parameteo-events/$FILENAME.hex.log 2>&1
|
||||
|
||||
echo "dumping to binary file ./parameteo-events/$FILENAME.bin"
|
||||
st-flash --debug --format ihex read ./parameteo-events/$FILENAME.bin 0x0805A800 0x22800 > ./parameteo-events/$FILENAME.bin.log 2>&1
|
||||
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
FILE=$1
|
||||
BSN=$(basename $FILE)
|
||||
TYPE_EXT=$(echo $BSN | grep -o -E ...$)
|
||||
TYPE=""
|
||||
|
||||
DATE=$(date +%Y%m%d)
|
||||
TIME=$(date +%H%M%S)
|
||||
|
||||
LOGFN=flashevent_$DATE-$TIME.log
|
||||
|
||||
if [ ! -f $1 ]; then
|
||||
echo "input file doesn't exists"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
if [ ${TYPE_EXT,,} = "bin" ]; then
|
||||
TYPE="binary"
|
||||
echo "flashing $BSN binary file into events area"
|
||||
elif [ ${TYPE_EXT,,} = "hex" ]; then
|
||||
TYPE="ihex"
|
||||
echo "flashing $BSN Intel-HEX file into events area"
|
||||
else
|
||||
echo "unknown file type"
|
||||
exit
|
||||
fi
|
||||
|
||||
st-flash --format $TYPE write $FILE 0x0805A800
|
||||
|
||||
|
Ładowanie…
Reference in New Issue