Commit 5c32e11a authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

allow to assign MAC address to SPEC in test03 of the PTS

parent 180efb56
......@@ -21,6 +21,10 @@ if [ x$extra_serial = x"" ]; then
extra_serial=0000
fi
# MAC address for the board
echo -n "Please, input MAC addres (use XX:XX:XX:XX:XX:XX format): "
read mac_addr
tmp=""
echo -n "--------------------------------------------------------------\n"
echo -n "Remove the jumper from the board!\n"
......@@ -28,7 +32,15 @@ echo -n "Press enter to continue...\n"
read tmp
echo -n "--------------------------------------------------------------\n"
sudo ./pts.py -b SPEC -s $serial -e $extra_serial -t./test/spec/python -l $LOGDIR 00 01 02 03 04 05 06 07 08 09 10 12
# Assemble pts.py call with parameters for SPEC
cmd="sudo ./pts.py -b SPEC -s "$serial" -e "$extra_serial
if [ ! x$mac_addr = x"" ]; then
cmd=$cmd" -m "$mac_addr
fi
cmd=$cmd" -t./test/spec/python -l "$LOGDIR" 00 01 02 03 04 05 06 07 08 09 10 12"
# Execute pts.py
$cmd
echo -n "Press enter to exit... "
......
......@@ -13,11 +13,15 @@ import os
import os.path
from ctypes import *
from ptsexcept import *
sys.path.append('sdbfs')
import gen_flash_image
"""
test03: loads a firmware file to Flash memory and boots from it. The FW just blinks the leds.
"""
mac_filename = 'mac.tmp'
class CGennumFlash :
GENNUM_FLASH = 1;
GENNUM_FPGA = 2;
......@@ -33,6 +37,26 @@ class CGennumFlash :
def main (default_directory='.'):
fpga_firmware = "/test_flash.bin"
# first try to read MAC address form file
filename = os.path.join(default_directory, mac_filename)
print "Trying to open " + filename
try:
macfile = open(filename, 'r')
except IOError:
print "MAC address not assigned..."
mac = ""
else:
mac = macfile.read()
macfile.close()
os.remove(filename)
print "MAC: " + mac
gen_flash_image.gen_sdb_image("flash", mac,
default_directory+"/test_flash.bin",
default_directory+"/test_flash_mac.bin")
fpga_firmware = "/test_flash_mac.bin"
gennum = rr.Gennum();
flash = CGennumFlash(gennum, default_directory);
......@@ -43,8 +67,8 @@ def main (default_directory='.'):
raise PtsError('Error: version of the flash is not correct: ' + version);
# Load a new firmware to the Flash memory.
print "Starting the process to load a FW into Flash memory"
flash.lib.load_mcs_to_flash(default_directory + "/test_flash.bin");
print "Starting the process to load a FW ("+default_directory+fpga_firmware+" into Flash memory"
flash.lib.load_mcs_to_flash(default_directory + fpga_firmware);
time.sleep(1);
print "Forcing to load FW from Flash memory to FPGA"
......
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