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 aa512117 authored by Reto Da Forno's avatar Reto Da Forno

scripts updated, support for new DPP2 LoRa platform added

parent 356c1812
......@@ -520,6 +520,11 @@ if [ ! "$2" = "-sdsetuponly" ]; then
ssh root@$GUMSTIX "chmod +x /usr/bin/cc2538-bsl.py";
fi
if [ ! "$2" = "-sdsetuponly" ]; then
echo "Upload stm32loader..."
scp $VARIOUSPATH/stm32loader/stm32loader.py root@$GUMSTIX:/usr/lib/python2.6/
fi
########################################################
#
# Test target slots
......
......@@ -18,18 +18,19 @@ tg_pwr_force_pwm = 1 ;set to force pwm mode on target voltage
; Default images config
[defaultimages]
img0_tmote = blink_flocklab_tmote_contiki.ihex ;Default image name for Tmote
img0_tinynode = blink_flocklab_tinynode184_tos2.ihex ;Default image name for TinyNode
img0_opal = blink_flocklab_opal_tos2.bin ;Default image name for Opal
img0_tinynode = blink_flocklab_tinynode184_tos2.ihex ;Default image name for TinyNode
img0_opal = blink_flocklab_opal_tos2.bin ;Default image name for Opal
img0_iris = blink_flocklab_iris_tos2.ihex ;Default image name for iris
img0_mica2 = blink_flocklab_mica2_tos2.ihex ;Default image name for Mica2
img0_wismote = blink_flocklab_wismote_contiki.ihex ;Default image name for Wismote
img0_cc430 = blink_flocklab_cc430_contiki.ihex ;Default image name for CC430
img0_acm2 = blink_flocklab_acm2.ihex ;Default image name for ACM2
img0_openmote = blink_flocklab_openmote.bin ;Default image name for OpenMote
img0_dpp = blink_flocklab_dpp_comm.ihex ;Default image name for DPP core 0
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_acm2 = blink_flocklab_acm2.ihex ;Default image name for ACM2
img0_openmote = blink_flocklab_openmote.bin ;Default image name for OpenMote
img0_dpp = blink_flocklab_dpp_comm.ihex ;Default image name for DPP core 0
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
; XML test configuration file settings
[xml]
......@@ -60,11 +61,11 @@ nthsample_default = 1 ;Default value for the nth_sample argument of AD
; FPGA DAQ
[daq]
serialport = /dev/flocklab/usb/daq3 ;Serial port for DAQ commands
dbd_threshold = 1 ;Number of samples to buffer before writing them to the db file
serialport = /dev/flocklab/usb/daq3 ;Serial port for DAQ commands
dbd_threshold = 1 ;Number of samples to buffer before writing them to the db file
fpga_chipselect = /proc/gpio/GPIO59
fpga_reset = /proc/gpio/GPIO76
dbd_max_wait_count = 60 ;Number of seconds the stop script waits for the dbd to finish
dbd_max_wait_count = 60 ;Number of seconds the stop script waits for the dbd to finish
; Moterunner specific config
[moterunner]
......
:020000040800F2
:1000000000C000204D06000899040008A70400085D
:10001000AD040008B3040008B904000800000000A3
:10002000000000000000000000000000BF04000805
:10003000CD04000800000000DB040008E90400080B
:100040009D0600089D0600089D0600089D06000804
:100050009D0600089D0600089D0600089D060008F4
:100060009D0600089D0600089D0600089D060008E4
:100070009D0600089D0600089D0600089D060008D4
:100080009D0600089D0600089D0600089D060008C4
:100090009D0600089D0600089D0600089D060008B4
:1000A0009D0600089D0600089D0600089D060008A4
:1000B0009D06000800000000000000009D060008EA
:1000C0009D0600089D0600089D0600089D06000884
:1000D0009D0600089D0600089D0600089D06000874
:1000E0009D0600089D0600080000000000000000BA
:1000F0000000000000000000000000000000000000
:10010000000000009D060008000000009D06000899
:100110000000000000000000850400089D060008A3
:100120009D0600089D0600089D0600089D06000823
:100130009D06000800000000000000000000000014
:100140009D0600089D0600089D0600089D06000803
:100150009D0600089D0600089D0600089D060008F3
:100160009D0600089D0600089D060008000000008E
:100170009D0600089D0600089D060008000000007E
:0C0180009D0600089D0600089D06000872
:10018C0010B5054C237833B9044B13B10448AFF3C5
:10019C0000800123237010BD00000020000000002F
:1001AC00E806000808B5034B1BB103490348AFF33D
:1001BC00008008BD0000000004000020E8060008D4
:1001CC0080B400AF044B1B680133034A136000BFBB
:1001DC00BD465DF8047B70471C00002080B582B0E2
:1001EC0000AF78607B681B681B6903F00203022B6D
:1001FC0022D17B681B68DB6803F00203022B1BD146
:10020C007B681B686FF002021A617B6801221A7707
:10021C007B681B689B6903F00303002B03D0786891
:10022C0000F0EEF805E0786800F0E0F8786800F08F
:10023C00F1F87B6800221A777B681B681B6903F056
:10024C000403042B22D17B681B68DB6803F00403D6
:10025C00042B1BD17B681B686FF004021A617B684E
:10026C0002221A777B681B689B6903F44073002B8E
:10027C0003D0786800F0C4F805E0786800F0B6F8B0
:10028C00786800F0C7F87B6800221A777B681B68D7
:10029C001B6903F00803082B22D17B681B68DB6801
:1002AC0003F00803082B1BD17B681B686FF0080256
:1002BC001A617B6804221A777B681B68DB6903F080
:1002CC000303002B03D0786800F09AF805E07868F7
:1002DC0000F08CF8786800F09DF87B6800221A77A3
:1002EC007B681B681B6903F01003102B22D17B6801
:1002FC001B68DB6803F01003102B1BD17B681B6899
:10030C006FF010021A617B6808221A777B681B68F1
:10031C00DB6903F44073002B03D0786800F070F8AD
:10032C0005E0786800F062F8786800F073F87B6894
:10033C0000221A777B681B681B6903F00103012BF1
:10034C000ED17B681B68DB6803F00103012B07D11E
:10035C007B681B686FF001021A61786800F082F804
:10036C007B681B681B6903F08003802B0ED17B68B4
:10037C001B68DB6803F08003802B07D17B681B684C
:10038C006FF080021A61786800F062F87B681B6875
:10039C001B6903F04003402B0ED17B681B68DB68A4
:1003AC0003F04003402B07D17B681B686FF04002C1
:1003BC001A61786800F038F87B681B681B6903F0D9
:1003CC002003202B0ED17B681B68DB6803F0200315
:1003DC00202B07D17B681B686FF020021A617868AC
:1003EC0000F02CF800BF0837BD4680BD80B483B048
:1003FC0000AF786000BF0C37BD465DF8047B7047DA
:10040C0080B483B000AF786000BF0C37BD465DF898
:10041C00047B704780B483B000AF786000BF0C37AA
:10042C00BD465DF8047B704780B483B000AF786044
:10043C0000BF0C37BD465DF8047B704780B483B0B9
:10044C0000AF786000BF0C37BD465DF8047B704789
:10045C0080B483B000AF786000BF0C37BD465DF848
:10046C00047B704780B582B000AF7860FFF7A8FEC0
:10047C0000BF0837BD4680BD80B500AF0248FFF70E
:10048C00ADFE00BF80BD00BF2000002080B400AFD7
:10049C0000BFBD465DF8047B704780B400AFFEE73B
:1004AC0080B400AFFEE780B400AFFEE780B400AFCD
:1004BC00FEE780B400AF00BFBD465DF8047B70471B
:1004CC0080B400AF00BFBD465DF8047B704780B4BC
:1004DC0000AF00BFBD465DF8047B704780B400AF31
:1004EC0000BFBD465DF8047B704780B489B000AF97
:1004FC00F860B9607A60FB681A68BB687B617B69DD
:10050C0093FAA3F33B613B69B3FA83F35B000321DA
:10051C0001FA03F3DB431A40BB68FB61FB6993FAF6
:10052C00A3F3BB61BB69B3FA83F35B00796801FA8F
:10053C0003F31A43FB681A6000BF2437BD465DF80D
:10054C00047B704780B483B000AF786039607B68FF
:10055C005A693B685A407B685A6100BF0C37BD46EC
:10056C005DF8047B7047000080B582B000AF00F0EE
:10057C0013F84FF480710748FFF7E4FF00237B600A
:10058C0002E07B6801337B607B684CF24F32934214
:10059C00F7D9EEE70004004880B582B000AF0B4AF3
:1005AC000A4BDB6C43F00203D364084BDB6C03F0A7
:1005BC0002037B607B6801224FF480710448FFF7D3
:1005CC0094FF00BF0837BD4680BD00BF001002403D
:1005DC000004004880B400AF174A174BD3F888309A
:1005EC0043F47003C2F88830144A144B1B6843F070
:1005FC0001031360114B00229A60104A0F4B1B68C9
:10060C0023F0A85323F4102313600C4B4FF48052A7
:10061C00DA600A4A094B1B6823F480231360074BEA
:10062C0000229A61044B4FF000629A6000BFBD46F5
:10063C005DF8047B704700BF00ED00E00010024045
:10064C00DFF834D0002103E00C4B5B5843500431ED
:10065C000B480C4B42189A42F6D30B4A02E000238B
:10066C0042F8043B094B9A42F9D3FFF7B3FF00F071
:10067C0011F8FFF779FFFEE700C00020080700081B
:10068C00000000200000002000000020600000207E
:10069C00FEE7000070B50D4E0D4CA41BA4100025F8
:1006AC00A54209D10B4E0C4C00F018F8A41BA41059
:1006BC000025A54205D170BD56F825309847013567
:1006CC00EEE756F8253098470135F2E700070008A9
:1006DC00000700080007000804070008F8B500BF71
:1006EC00F8BC08BC9E467047F8B500BFF8BC08BC07
:0406FC009E4670475F
:04070000B10100083B
:040704008D0100085B
:040000050800064D9C
:00000001FF
......@@ -353,10 +353,10 @@ def main(argv):
if debug:
logger.warn(msg)
# Set voltage to maximum, keep target on ---
# Set voltage to maximum, turn target off ---
if slotnr != None:
if flocklab.tg_pwr_get(slotnr) <> 1:
flocklab.tg_pwr_set(slotnr, 1)
#if flocklab.tg_pwr_get(slotnr) <> 1:
# flocklab.tg_pwr_set(slotnr, 1)
msg = None
for i in range(0,5):
try:
......@@ -367,6 +367,9 @@ def main(argv):
if msg:
errors.append(msg)
logger.error(msg)
# Turn target off
if flocklab.tg_pwr_get(slotnr) <> 0:
flocklab.tg_pwr_set(slotnr, 0)
# Remove config directory ---
if os.path.exists("%s/%d" % (config.get("observer", "testconfigfolder"), testid)):
......
......@@ -25,7 +25,7 @@ version = filter(str.isdigit, __version__)
###
imagefile = None
target = None
targetlist = ('tmote', 'tinynode', 'opal', 'iris', 'mica2', 'wismote', 'cc430', 'acm2', 'openmote', 'dpp')
targetlist = ('tmote', 'tinynode', 'opal', 'iris', 'mica2', 'wismote', 'cc430', 'acm2', 'openmote', 'dpp', 'dpp2lora')
porttypelist= ('usb', 'serial')
porttype = None
pin_rst = '/sys/devices/platform/gpio/TARGET_RST/'
......@@ -537,7 +537,6 @@ def reprog_openmote(imagefile, slotnr):
##############################################################################
def reprog_dpp(imagefile, slotnr, core):
port = '/dev/ttyS1'
core2sig = ((0,0),(1,0),(0,1),(1,1)) # (sig1,sig2)
init_pins((pin_prog, pin_rst, pin_sig1, pin_sig2))
# select core
......@@ -595,6 +594,66 @@ def reprog_msp432(imagefile, slotnr, port, speed):
return 0
### END reprog_msp432()
##############################################################################
#
# reprog_stm32l4
#
##############################################################################
def reprog_dpp2lora(imagefile, slotnr):
port = '/dev/ttyS1'
init_pins((pin_prog, pin_rst))
return reprog_stm32l4(imagefile, slotnr, port)
### END reprog_dpp2lora()
def reprog_stm32l4(imagefile, slotnr, port, speed=115200):
usleep = 0.0005
import stm32loader
# BSL entry sequence
set_pin(pin_rst, 1)
set_pin(pin_prog, 1)
time.sleep(usleep)
set_pin(pin_rst, 0)
# call the bootloader script
loader = stm32loader.Stm32Loader()
loader.configuration['data_file'] = imagefile
loader.configuration['port'] = port
loader.configuration['baud'] = 115200
loader.configuration['parity'] = serial.PARITY_EVEN
loader.configuration['erase'] = True
loader.configuration['write'] = True
loader.configuration['verify'] = True
if debug:
stm32loader.VERBOSITY = 10
else:
stm32loader.VERBOSITY = 0
try:
loader.connect()
if loader.read_device_details() != 0x435:
print "invalid device ID"
flocklab.tg_reset(usleep)
return 2
loader.perform_commands()
except Exception:
flocklab.tg_reset(usleep)
return 3
set_pin(pin_prog, 0)
# Revert back all config changes:
subprocess.call(["stty", "-F", port, "-parenb", "iexten", "echoe", "echok", "echoctl", "echoke", "115200"])
# Reset if not forbidden by caller:
if noreset:
flocklab.tg_reset_keep()
else:
flocklab.tg_reset(usleep)
return 0
### END reprog_stm32l4()
##############################################################################
#
# Main
......@@ -675,7 +734,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')):
elif (target in ('tinynode', 'cc430', 'acm2', 'openmote', 'dpp', 'dpp2lora')):
porttype = 'serial'
# Check port type restrictions for targets:
......@@ -683,7 +742,7 @@ def main(argv):
err = "Error: port type for target %s has to be usb." %target
logger.error(str(err))
sys.exit(errno.EINVAL)
elif (target in ('cc430','acm2', 'openmote','dpp')) and (porttype != 'serial'):
elif (target in ('cc430','acm2', 'openmote', 'dpp', 'dpp2lora')) and (porttype != 'serial'):
err = "Error: port type for target %s has to be serial." %target
logger.error(str(err))
sys.exit(errno.EINVAL)
......@@ -745,6 +804,8 @@ 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':
rs = reprog_dpp2lora(imagefile, slotnr)
# Turn off USB power if needed:
if porttype == 'usb':
......
#!/bin/bash
#obslist="001 002 003 004 006 007 008 010 011 013 014 015 016 017 018 019 020 022 023 024 025 026 027 028 031 032 033"
obslist="029"
for OBS in $obslist
do
echo "updating observer ${OBS}..."
#ssh flocklab-observer${OBS} "mount -o remount,rw /"
#scp testmanagement/tg_reprog.py flocklab-observer${OBS}:/usr/bin/
#ssh flocklab-observer${OBS} "mount -o remount,ro /"
done
modified version of the stm32loader by florisla:
https://github.com/florisla/stm32loader
This diff is collapsed.
#!/bin/bash
# general purpose update script, can be utilized to execute commands on all observers
#
# observer list: 001 002 003 004 006 007 008 010 011 013 014 015 016 017 018 019 020 022 023 024 025 026 027 028 031 032 033 200 201 202 204
for OBS in 001 002 003 004 006 007 008 010 011 013 014 015 016 017 018 019 020 022 023 024 025 026 027 028 031 032 033 200 201 202 204
do
echo "updating observer ${OBS}..."
#ssh flocklab-observer${OBS} "mount -o remount,rw /"
#scp syslog-ng.conf flocklab-observer${OBS}:/etc/syslog-ng.conf
#ssh flocklab-observer${OBS} "mount -o remount,ro / ; /etc/init.d/syslog restart"
done
......@@ -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"/>
<xs:pattern value="tmote|tinynode|opal|iris|mica2|wismote|cc430|acm2|openmote|dpp|dpp2lora"/>
</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|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|200|201|202|204"/>
</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