-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRP2350_ReadMem.py
64 lines (57 loc) · 1.22 KB
/
RP2350_ReadMem.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#memory read via MircoPython
import rp2
@micropython.asm_thumb
def ReadMem(r0):
ldr(r0, [r0, 0])
def tohex(val, nbits):
return hex((val + (1 << nbits)) % (1 << nbits))
print("bootrom:")
v = ReadMem(0x0) #SP top
print(tohex(v, 32))
v = ReadMem(0x4) #ResetHandler
print(tohex(v, 32))
v = ReadMem(0x8) #NMI - enabled always
print(tohex(v, 32))
v = ReadMem(0xc) #HardFault - enabled always
print(tohex(v, 32))
v = ReadMem(0x10) #memory fault!
print(tohex(v, 32))
v = ReadMem(0x14) #bus fault!
print(tohex(v, 32))
v = ReadMem(0x18)
print(tohex(v, 32))
v = ReadMem(0x1C)
print(tohex(v, 32))
v = ReadMem(0x20)
print(tohex(v, 32))
v = ReadMem(0x24)
print(tohex(v, 32))
v = ReadMem(0x28)
print(tohex(v, 32))
v = ReadMem(0x2C)
print(tohex(v, 32))
v = ReadMem(0x30)
print(tohex(v, 32))
v = ReadMem(0x34)
print(tohex(v, 32))
v = ReadMem(0x38)
print(tohex(v, 32))
v = ReadMem(0x3C)
print(tohex(v, 32))
v = ReadMem(0x40)
print(tohex(v, 32))
v = ReadMem(0x44)
print(tohex(v, 32))
v = ReadMem(0x48)
print(tohex(v, 32))
print("chip ID:")
v = ReadMem(0x40000000)
print(tohex(v, 32))
v = ReadMem(0x40000004)
print(tohex(v, 32))
v = ReadMem(0x40000008)
print(tohex(v, 32))
v = ReadMem(0x40000014)
print(tohex(v, 32))
v = ReadMem(0x2f8)
print(tohex(v, 32))