-
Notifications
You must be signed in to change notification settings - Fork 1
/
autoJlink.py
46 lines (36 loc) · 1.24 KB
/
autoJlink.py
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
41
42
43
import re
import csv
from src.link import *
modelNum = input("Input CPU Model Number: ")
speed = input("Please enter JTAG connection speed, if unknown, please hit enter: ")
if speed == '':
speed = 4000
cpuInfo = info(modelNum, speed)
for inform in cpuInfo:
print(inform)
#print("\n")
print("\n")
file = 'out.bin'
answer = input("Read Memory? (y/n): ")
if answer == 'y' or 'yes':
with open(r'src/memSizes.json', 'r') as f:
try:
sizes = json.loads(f)
except TypeError:
sizes = ['LPC2101', 0xFF000000]
pass
if modelNum in sizes:
addr = 0
length = sizes[0]
else:
addr = input("Enter the starting address for memory acquisition: ")
length = input("Enter the length of acquisition in bits: ")
ans = input("Does CPU need to be halted for memory acquisition? If unknown, please hit enter (y/n): ")
print("Memory acquisition starting ...", flush=True)
filename = lEndian(modelNum, speed, addr, length, ans)
if(filename == 'Error'):
print("Could not save memory acquisition to file, please check connections and debugger")
else:
print("Memory acquired, saved in ", filename)
else:
exit()