diff --git a/flash.config b/flash.config index 7dcf348ab14b8f2961d119babe74517452b6ef8a..e7941b24b7ed4988895fcd0590af04b17643bf22 100644 --- a/flash.config +++ b/flash.config @@ -4,4 +4,5 @@ FACT_IMAGE_UNB2B=${UNB2_IMAGES}/unb2b_minimal-rce6b96eed.rbf USER_IMAGE_UNB2B=${UNB2_IMAGES}/lofar2_unb2b_sdp_station_full_wg-b3d679286.rbf # FACT_IMAGE_UNB2C=${UNB2_IMAGES}/unb2c_minimal-re6769e2e3.rbf FACT_IMAGE_UNB2C=${UNB2_IMAGES}/unb2c_test_ddr_16G_I-r5f4ea2394.rbf -USER_IMAGE_UNB2C=${UNB2_IMAGES}/lofar2_unb2c_sdp_station_full-dbc6375ef.rbf +# USER_IMAGE_UNB2C=${UNB2_IMAGES}/lofar2_unb2c_sdp_station_full-dbc6375ef.rbf +USER_IMAGE_UNB2C=${UNB2_IMAGES}/lofar2_unb2c_sdp_station_full-d601da896.rbf diff --git a/flash_image b/flash_image index c2d3569be382e26ef52690a704c8c60e43795a86..5a8cb112794b201000628bc780539b661e618221 100755 --- a/flash_image +++ b/flash_image @@ -31,7 +31,7 @@ # - call this script to flash the factory image: # ./flash_image -h # ./flash_image unb2c --fact --user -# ./flash_image unb2c --fact --user --host dop386 --port 4840 +# ./flash_image unb2c --fact --user --host dop386 --port 4840 --nodes 0,2,8:15 # - see flash_status.txt for status: # cat flash_status.txt ############################################################################### @@ -71,6 +71,7 @@ Options: --host=* which host to connect to. --port=* which opc-ua port to use. --fact: flash factory image. --user: flash user image. + --nodes=*: nodes to flash (* = 0,3,5 or 8:15) --> Note: It does not matter where the options are placed: before, in between or after the arguments. @EndOfHelp@ exit 1 @@ -82,6 +83,7 @@ host= port=4840 fact= user= +nodes= while [[ $# -gt 0 ]] do @@ -92,6 +94,9 @@ do --port=*) port=${1#*=} ;; + --nodes=*) + nodes=${1#*=} + ;; --fact) fact="flash" ;; @@ -149,14 +154,23 @@ fi # source init_sdptr_python.sh cd ${SDPTR_DIR} source ./init_sdptr_python.sh - -sdp_rw.py --host ${host} --port ${port} -r firmware_version +if [[ -n "${nodes}" ]]; then + sdp_rw.py --host ${host} --port ${port} --nodes ${nodes} -r firmware_version +else + sdp_rw.py --host ${host} --port ${port} -r firmware_version +fi # write fact and/or user image # fact image is important, so verify it. # if [[ -n "${fact}" ]]; then - sdp_firmware.py --host "${host}" --port "${port}" --write --read --verify --image FACT --file "${FACT_IMAGE}" + if [[ -n "${nodes}" ]]; then + echo "flash factory image to nodes: ${nodes}" + sdp_firmware.py --host "${host}" --port "${port}" --nodes "${nodes}" --write --read --verify --image FACT --file "${FACT_IMAGE}" + else + echo "flash factory image to all nodes" + sdp_firmware.py --host "${host}" --port "${port}" --write --read --verify --image FACT --file "${FACT_IMAGE}" + fi if grep -Fq "NOT SAME" "${LOGFILE}"; then # if found @@ -171,7 +185,13 @@ if [[ -n "${fact}" ]]; then fi if [[ -n "${user}" ]]; then - sdp_firmware.py --host "${host}" --port "${port}" --write --image USER --file "${USER_IMAGE}" + if [[ -n "${nodes}" ]]; then + echo "flash user image to nodes: ${nodes}" + sdp_firmware.py --host "${host}" --port "${port}" --nodes "${nodes}" --write --image USER --file "${USER_IMAGE}" + else + echo "flash user image to all nodes" + sdp_firmware.py --host "${host}" --port "${port}" --write --image USER --file "${USER_IMAGE}" + fi echo "SUCCESS, flashing user image" echo "FLASH-USER-IMAGE-SUCCESS" >> "${STATEFILE}" fi diff --git a/test/py/control/sdp_rw.py b/test/py/control/sdp_rw.py index cea2722a4c9819b2d4016a085197917c858541ec..6b6b262c3ebe3f6ae38c7beec854f8aeae4036f6 100755 --- a/test/py/control/sdp_rw.py +++ b/test/py/control/sdp_rw.py @@ -106,7 +106,6 @@ def main(): if args.read: data = client.read(args.read[0]) success = False if data is None else True - if not success: print(f"opcua.read {args.read[0]} not available") else: @@ -133,6 +132,9 @@ def main(): col = 0 node = client.gn_first_fpga for d in data: + if node not in nodelist: + node += 1 + continue line.append(f"{str(d):4s}") col += 1 if col == cols: