To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 4fbf4c6d authored by Reto Da Forno's avatar Reto Da Forno

new target added to support two antenna types for DPP2

parent 6630dc9b
......@@ -30,6 +30,7 @@ img1_dpp = blink_flocklab_dpp_bolt.ihex ;Default image name for DPP core 1
img2_dpp = blink_flocklab_dpp_app.ihex ;Default image name for DPP core 2
optional_img3_dpp = blink_flocklab_acm2.ihex ;Default image name for DPP core 3, do not report error if reprogramming fails
img0_dpp2lora = blink_flocklab_dpp2_lora.ihex ;Default image name for DPP2 LoRa Comboard
img0_dpp2lorahg = blink_flocklab_dpp2_lora.ihex ;Default image name for DPP2 LoRa Comboard
; XML test configuration file settings
[xml]
......
......@@ -25,7 +25,7 @@ version = filter(str.isdigit, __version__)
###
imagefile = None
target = None
targetlist = ('tmote', 'tinynode', 'opal', 'iris', 'mica2', 'wismote', 'cc430', 'acm2', 'openmote', 'dpp', 'dpp2lora')
targetlist = ('tmote', 'tinynode', 'opal', 'iris', 'mica2', 'wismote', 'cc430', 'acm2', 'openmote', 'dpp', 'dpp2lora', 'dpp2lorahg')
porttypelist= ('usb', 'serial')
porttype = None
pin_rst = '/sys/devices/platform/gpio/TARGET_RST/'
......@@ -735,7 +735,7 @@ def main(argv):
if not porttype:
if (target in ('tmote', 'opal', 'iris', 'mica2', 'wismote')):
porttype = 'usb'
elif (target in ('tinynode', 'cc430', 'acm2', 'openmote', 'dpp', 'dpp2lora')):
elif (target in ('tinynode', 'cc430', 'acm2', 'openmote', 'dpp', 'dpp2lora', 'dpp2lorahg')):
porttype = 'serial'
# Check port type restrictions for targets:
......@@ -805,7 +805,7 @@ def main(argv):
elif target == 'dpp':
logger.info("reprog dpp with image %s, slot %d, core %d." % (imagefile, slotnr, core))
rs = reprog_dpp(imagefile, slotnr, core)
elif target == 'dpp2lora':
elif target == 'dpp2lora' or target == 'dpp2lorahg':
rs = reprog_dpp2lora(imagefile, slotnr)
# Turn off USB power if needed:
......
......@@ -433,6 +433,9 @@ def main(argv):
obsiddict[obsid][core]=(opersys, platform)
# Get the image and save it to a temporary file:
image = imageconf[0].xpath('d:data', namespaces=ns)[0].text
# For target platform DPP2LoRa, the <data> tag may be empty
if len(image.strip()) == 0 and (platform.lower() == "dpp2lora" or platform.lower() == "dpp2lorahg"):
continue # skip image validation
image_line = imageconf[0].xpath('d:data', namespaces=ns)[0].sourceline
(fd, imagefilename) = tempfile.mkstemp()
imagefile = os.fdopen(fd, 'w+b')
......
......@@ -1019,7 +1019,24 @@ function update_add_test($xml_config, &$errors, $existing_test_id = NULL, $abort
$embeddedImages[$eId] = $im_cpy;
}
}
foreach ($used_embeddedImages as $imId)
// check if there are images without a data block:
foreach(array_keys($embeddedImages) as $imID) {
if(strlen($embeddedImages[$imID]['data']) == 0) {
// find the first entry which matches the platform (compare only first 3 characters)
foreach($embeddedImages as $eIm) {
if(strncmp($eIm['platform'], $embeddedImages[$imID]['platform'], 3) && strlen($eIm['data']) > 0) {
$embeddedImages[$imID]['data'] = $eIm['data']; // use the image data of this entry
break;
}
}
if(strlen($embeddedImages[$imID]['data']) == 0) {
// no image data found -> abort
array_push($errors, "No data provided for embedded image ID ".$imID.".");
break;
}
}
}
foreach($used_embeddedImages as $imId)
if (!array_key_exists($imId, $embeddedImages))
array_push($errors, "Missing embedded image (ID ".$imId.")");
if (empty($errors)) {
......
......@@ -317,7 +317,7 @@
<!-- Type definition for platforms -->
<xs:simpleType name="platformType">
<xs:restriction base="xs:string">
<xs:pattern value="tmote|tinynode|opal|iris|mica2|wismote|cc430|acm2|openmote|dpp|dpp2lora"/>
<xs:pattern value="tmote|tinynode|opal|iris|mica2|wismote|cc430|acm2|openmote|dpp|dpp2lora|dpp2lorahg"/>
</xs:restriction>
</xs:simpleType>
......@@ -341,7 +341,7 @@
<xs:simpleType name="obsIdType">
<xs:restriction base="xs:integer">
<xs:pattern value="001|002|003|004|006|007|008|010|011|013|014|015|016|017|018|019|020|022|023|024|025|026|027|028|029|031|032|033|200|201|202|204"/>
<xs:pattern value="001|002|003|004|006|007|008|010|011|013|014|015|016|017|018|019|020|022|023|024|025|026|027|028|029|031|032|033|300|301|302|303"/>
</xs:restriction>
</xs:simpleType>
......
Markdown is supported
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