Compare commits

...

6 commits

Author SHA1 Message Date
Stephan I. Böttcher
cbd60728e9 .gitignore oops.txt 2024-11-15 17:53:34 +01:00
Stephan I. Böttcher
a4a0898c48 Merge branch 'dlrena' of forge.bexus.org:Stephan/irena-arm into dlrena 2024-11-15 17:52:13 +01:00
Stephan I. Böttcher
db69642f35 armlib.py: --serialr= reverse uart RESET polarity 2024-11-15 17:50:32 +01:00
Stephan I. Böttcher
ca2c37e3ef oops.py: python3 2024-11-15 17:48:48 +01:00
Stephan I. Böttcher
21217d00a9 ssp_variable_names: fix termination 2024-11-15 15:04:51 +01:00
Stephan Boettcher
ad63785861 armlib: ipython3 2024-11-15 15:02:45 +01:00
4 changed files with 17 additions and 13 deletions

1
.gitignore vendored
View file

@ -9,3 +9,4 @@ __pycache__
revision.h+
*~
*.s
oops.txt

View file

@ -1,4 +1,4 @@
#!/usr/bin/ipython --profile=armlib
#!/usr/bin/ipython3 --profile=armlib
import sys, time, threading
@ -604,7 +604,7 @@ def init_irena(scope, name="xRENA", prod=None, options="", long_options=[]):
oo,ff = getopt.getopt(sys.argv[1:],
"A:U:N:S:X"+options,
["autostart=","network=","usb=",
"serial=","isp=","reset-port=",
"serialr=", "serial=","isp=","reset-port=",
"none"]+long_options)
_opt = (oo,ff)
autostart = None
@ -620,10 +620,13 @@ def init_irena(scope, name="xRENA", prod=None, options="", long_options=[]):
if o in "-N -U -S -X --network --usb --serial --isp --none":
if _ifc:
raise ValueError("multiple interface options -N -U -S -X")
if o in "-S --serial --isp --reset-port":
if o in "-S --serialr --isp --reset-port":
if _ifc_uart:
raise ValueError("--reset-port with --serial")
import uartterm
if o == "--serialr":
uartterm.uart.RESET_ASSERT=False
uartterm.uart.RESET_DEASSERT=True
if not o=="--reset-port":
_ifc_uart = uartterm.init_uart(scope=scope, dname=name, addr=v, isp=o=="--isp")
_ifc = _ifc_uart

18
oops.py
View file

@ -1,4 +1,4 @@
#! /usr/bin/pythom
#! /usr/bin/python3
class oops(object):
@ -102,14 +102,14 @@ class oops(object):
def report_addr(self, addr):
m,s = self.find_addr(addr)
r = "0x%08x " % addr
r = f"0x{addr:08x} "
if s:
if isinstance(s, tuple):
r += "%s %s:" % (s[1],s[0])
r += f"{s[1]} {s[0]}:"
else:
r += "%s " % s
r += "{s} "
if m:
r += "%s + 0x%04x" % (m, addr - self.map[m]["addr"])
r += f"{m} + 0x{addr - self.map[m]['addr']:04x}"
return r+'\n'
def open(self, filename="oops.txt"):
@ -119,17 +119,17 @@ class oops(object):
def stackdump(self, l):
ll = l.split()
if ll[0][:3] != "@0x" or ll[0][-1]!=":":
if ll[0][:3] != b"@0x" or ll[0][-1:]!=b":":
return ""
a = int(ll[0][1:-1], 16)
import time
r = time.strftime("Stackdump at %Y-%m-%dT%H:%M:%SZ:\n", time.gmtime())
for aa in ll[1:]:
r += "@0x%08x " % a
r += f"@0x{a:08x} "
a += 4
aaa = int(aa,16)
aaa = int(aa, 16)
if aaa==self.stack_guard:
r += "0x%08x Stack guard\n" % aaa
r += f"0x{aaa:08x} Stack guard\n"
else:
r += self.report_addr(aaa)
self.f.write(r)

2
ssp.c
View file

@ -456,7 +456,7 @@ const struct keywords ssp_variable_names[] = {
VARIABLE("ssp_adc", &ssp_conf_adc),
VARIABLE("ssp_dac", &ssp_conf_dac),
VARIABLE("ssp_pressure", &ssp_conf_bate),
{}
KW_END
};
error_msg_t ssp_error(const char *m, int c)