Return exit code when openocd command failed in download script
authorjunmin kim <junmindd.kim@samsung.com>
Wed, 11 Oct 2017 10:21:22 +0000 (03:21 -0700)
committerjunmin kim <junmindd.kim@samsung.com>
Wed, 11 Oct 2017 10:55:50 +0000 (03:55 -0700)
If openocd return non-zero exit code, download script exits with exit code 1

build/configs/artik053/artik053_download.sh
build/configs/sidk_s5jt200/sidk_s5jt200_download.sh

index be895dc..0fa4b9a 100755 (executable)
@@ -68,7 +68,7 @@ romfs()
                pushd ${OPENOCD_DIR_PATH}
                ${OPENOCD_BIN_PATH}/openocd -c "${OPENOCD_ROMFS}" -f artik053.cfg -c '  \
                flash_write rom ../../../../output/bin/romfs.img; \
-               exit'
+               exit' || finish_download 1
                popd
        fi
 }
@@ -111,7 +111,7 @@ main()
                        flash_write sssfw ../../bin/sssfw.bin;          \
                        flash_write wlanfw ../../bin/wlanfw.bin;        \
                        flash_write os ../../../../output/bin/tinyara_head.bin; \
-                       exit'
+                       exit' || finish_download 1
                        popd
 
                        # check romfs and download it
@@ -124,7 +124,7 @@ main()
                        pushd ${OPENOCD_DIR_PATH}
                        ${OPENOCD_BIN_PATH}/openocd -c "${OPENOCD_ROMFS}" -f artik053.cfg -c '  \
                        flash_erase_part user;  \
-                       exit'
+                       exit' || finish_download 1
                        popd
                        ;;
 
index c29c7e2..39652e1 100755 (executable)
@@ -99,7 +99,7 @@ main()
 
                        # download all binaries using openocd script
                        pushd ${OPENOCD_DIR_PATH}
-                       ${OPENOCD_BIN_PATH}/openocd -f s5jt200_silicon_evt0_fusing_flash_all.cfg
+                       ${OPENOCD_BIN_PATH}/openocd -f s5jt200_silicon_evt0_fusing_flash_all.cfg || exit 1
                        popd
                        ;;