-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathdump_config2.sh
More file actions
40 lines (29 loc) · 931 Bytes
/
dump_config2.sh
File metadata and controls
40 lines (29 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
#
# This script will dump the current configuration memory to the command line.
# Use ./dump_config.sh >> test_pattern15.h to capture your configuration to a file. Replace 7i96 with your firmware name.
# Use ./dump_config.sh >> test_pattern15.b to capture your configuration to a binary file.
# Want to use --rpo from 0x0000 - 0x6100.
#
ADDR=0
#END=0x6100 or decimal 24832
# format output in columns.
COLUMN=0
echo "/*"
echo " Header file containing configuration memory dump."
echo " You may use tests/hm-test/dump_config.sh to create this file."
echo "*/"
echo ""
echo "#pragma once"
echo ""
echo "const uint32_t config_memory_dump[] = {"
while [ $ADDR -lt 24832 ]
do
echo -n "0x"
v=$(mesaflash --addr 10.10.10.10 --device 7i96 --rpo $ADDR)
echo "mesaflash returns $v for $ADDR"
#var_value=$(echo "${arr[3]}" | sed 's/0x0\+//')
print "%u" $ADDR
ADDR=$(( $ADDR + 4 ))
done
echo "};"