Compare commits

..

No commits in common. "cbd60728e9a8032bd124e4c34eb464f09a700926" and "a75d940be5dddce929197b3d0e4a7ec029331e71" have entirely different histories.

4 changed files with 13 additions and 17 deletions

1
.gitignore vendored
View file

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

View file

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

18
oops.py
View file

@ -1,4 +1,4 @@
#! /usr/bin/python3 #! /usr/bin/pythom
class oops(object): class oops(object):
@ -102,14 +102,14 @@ class oops(object):
def report_addr(self, addr): def report_addr(self, addr):
m,s = self.find_addr(addr) m,s = self.find_addr(addr)
r = f"0x{addr:08x} " r = "0x%08x " % addr
if s: if s:
if isinstance(s, tuple): if isinstance(s, tuple):
r += f"{s[1]} {s[0]}:" r += "%s %s:" % (s[1],s[0])
else: else:
r += "{s} " r += "%s " % s
if m: if m:
r += f"{m} + 0x{addr - self.map[m]['addr']:04x}" r += "%s + 0x%04x" % (m, addr - self.map[m]["addr"])
return r+'\n' return r+'\n'
def open(self, filename="oops.txt"): def open(self, filename="oops.txt"):
@ -119,17 +119,17 @@ class oops(object):
def stackdump(self, l): def stackdump(self, l):
ll = l.split() ll = l.split()
if ll[0][:3] != b"@0x" or ll[0][-1:]!=b":": if ll[0][:3] != "@0x" or ll[0][-1]!=":":
return "" return ""
a = int(ll[0][1:-1], 16) a = int(ll[0][1:-1], 16)
import time import time
r = time.strftime("Stackdump at %Y-%m-%dT%H:%M:%SZ:\n", time.gmtime()) r = time.strftime("Stackdump at %Y-%m-%dT%H:%M:%SZ:\n", time.gmtime())
for aa in ll[1:]: for aa in ll[1:]:
r += f"@0x{a:08x} " r += "@0x%08x " % a
a += 4 a += 4
aaa = int(aa, 16) aaa = int(aa,16)
if aaa==self.stack_guard: if aaa==self.stack_guard:
r += f"0x{aaa:08x} Stack guard\n" r += "0x%08x Stack guard\n" % aaa
else: else:
r += self.report_addr(aaa) r += self.report_addr(aaa)
self.f.write(r) 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_adc", &ssp_conf_adc),
VARIABLE("ssp_dac", &ssp_conf_dac), VARIABLE("ssp_dac", &ssp_conf_dac),
VARIABLE("ssp_pressure", &ssp_conf_bate), VARIABLE("ssp_pressure", &ssp_conf_bate),
KW_END {}
}; };
error_msg_t ssp_error(const char *m, int c) error_msg_t ssp_error(const char *m, int c)