artik053: add flashing script to erase user fs
authorsunghan <sh924.chang@samsung.com>
Tue, 19 Sep 2017 08:16:42 +0000 (17:16 +0900)
committersunghan <sh924.chang@samsung.com>
Tue, 19 Sep 2017 08:16:42 +0000 (17:16 +0900)
Sometimes, we should erase user fs at first flashing on new board.
So, ERASE_USERFS option is added.

build/configs/artik053/.flashSpec.xml
build/configs/artik053/artik053_download.sh

index 6ffdb58..c774b02 100644 (file)
@@ -21,5 +21,6 @@
     </executors>
     <options>
         <option>ALL</option>
+        <option>ERASE_USERFS</option>
     </options>
 </flash>
index c3be9c9..fedaca7 100755 (executable)
@@ -102,9 +102,26 @@ main()
                        popd
                        ;;
 
+               ERASE_USERFS|erase_userfs)
+                       echo "USERFS :"
+
+                       ROMFS_FLASHING_CFG=${OPENOCD_DIR_PATH}/romfs_flashing.cfg
+                       echo "set romfs_partition_enable 0" > ${ROMFS_FLASHING_CFG}
+                       if [ "${CONFIG_FS_ROMFS}" == "y" ]; then
+                               echo "set romfs_partition_enable 1" > ${ROMFS_FLASHING_CFG}
+                       fi
+
+                       pushd ${OPENOCD_DIR_PATH}
+                       ${OPENOCD_BIN_PATH}/openocd -f artik053.cfg -c '        \
+                       flash_erase_part user;  \
+                       exit'
+                       rm ${ROMFS_FLASHING_CFG}
+                       popd
+                       ;;
+
                *)
                        echo "${arg} is not suppported in artik053"
-                       echo "Usage : make download [ ALL ]"
+                       echo "Usage : make download [ ALL | ERASE_USERFS ]"
                        exit 1
                        ;;
                esac