Commit 49b7c90c authored by Reto Da Forno's avatar Reto Da Forno
Browse files

new port SWO added for serial logging

parent e67e2cd7
......@@ -476,15 +476,15 @@ def start_test(testid, cur, cn, obsdict_key, obsdict_id):
port = srconf.xpath('d:port', namespaces=ns)
if port:
port = port[0].text.strip()
xmlblock += "\t<port>%s</port>\n" %port
xmlblock += "\t<port>%s</port>\n" % port
baudrate = srconf.xpath('d:baudrate', namespaces=ns)
if baudrate:
baudrate = baudrate[0].text.strip()
xmlblock += "\t<baudrate>%s</baudrate>\n" %baudrate
mode = srconf.xpath('d:mode', namespaces=ns)
if mode:
mode = mode[0].text.strip()
xmlblock += "\t<mode>%s</mode>\n" %mode
xmlblock += "\t<baudrate>%s</baudrate>\n" % baudrate
cpuspeed = srconf.xpath('d:cpuSpeed', namespaces=ns)
if cpuspeed:
cpuspeed = cpuspeed[0].text.strip()
xmlblock += "\t<cpuSpeed>%s</cpuSpeed>\n" % cpuspeed
xmlblock += "</obsSerialConf>\n\n"
for obsid in obsids:
obsid = int(obsid)
......
......@@ -583,6 +583,12 @@ def main(argv):
if not quiet:
print("Element serialConf: Some observer IDs have been used but do not have a targetConf element associated with them.")
errcnt = errcnt + 1
serialconfs = tree.xpath('//d:serialConf', namespaces=ns)
obsWithSWOSerial = []
for serialconf in serialconfs:
port = serialconf.find('d:port', namespaces=ns)
if port != None and "swo" in port.text:
obsWithSWOSerial.extend(serialconf.find('d:obsIds', namespaces=ns).text.split())
# debugConf additional validation
(debugObsIds, duplicates, allInList) = check_obsids(tree, '//d:debugConf/d:obsIds', ns, obsidlist)
......@@ -600,14 +606,23 @@ def main(argv):
errcnt = errcnt + 1
obsWithSWO = []
obsWithSWD = []
debugconf = tree.xpath('//d:debugConf', namespaces=ns)
for debugconf in debugconf:
debugconfs = tree.xpath('//d:debugConf', namespaces=ns)
for debugconf in debugconfs:
dbgobs = debugconf.find('d:obsIds', namespaces=ns).text.split()
if debugconf.find('d:gdbPort', namespaces=ns) != None:
obsWithSWD.extend(dbgobs)
if debugconf.find('d:dataTraceConf', namespaces=ns) != None:
obsWithSWO.extend(dbgobs)
# check if data trace and SWO serial is used simultaneously on an observer
for obs in obsWithSWOSerial:
if obs in obsWithSWO:
if not quiet:
print("Element serialConf and debugConf: SWO serial and data trace cannot be used at the same time.")
errcnt = errcnt + 1
else:
obsWithSWO.append(obs) # add to SWO list for further checks below
# gpioTracingConf additional validation ---------------------------------------
# * observer ids need to have a targetConf associated and must be unique
# * Every (pin, edge) combination can only be used once.
......@@ -646,12 +661,12 @@ def main(argv):
pins = gpiomonconf.find('d:pins', namespaces=ns)
if usesSWD and ("INT2" in pins.text or "LED3" in pins.text):
if not quiet:
print("Line %d: Pins INT2 and LED3 cannot be traced on target platform DPP2LoRa when the debug service is used." % (pins.sourceline))
print("Line %d: Pins INT2 and LED3 cannot be traced on target platform DPP2LoRa if the debug service is used." % (pins.sourceline))
errcnt = errcnt + 1
break
if usesDataTrace and ("LED2" in pins.text):
if not quiet:
print("Line %d: Pins LED2 cannot be traced on target platform DPP2LoRa when the data trace service is used." % (pins.sourceline))
print("Line %d: Pins LED2 cannot be traced on target platform DPP2LoRa if the SWO pin is used." % (pins.sourceline))
errcnt = errcnt + 1
# gpioActuationConf additional validation ---------------------------
......
......@@ -184,7 +184,7 @@
<xs:element name="port" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="usb|serial"/>
<xs:pattern value="usb|serial|swo"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
......@@ -210,6 +210,7 @@
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="cpuSpeed" type="cpuSpeedType" minOccurs="0" maxOccurs="1"/>
<xs:element name="remoteIp" type="ipType" minOccurs="0"/>
</xs:all>
</xs:complexType>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment