Bug fixes when flashing multiple chips

chip/stable
Wynter Woods 7 years ago
parent 80e91d3e85
commit 63b98b6bc5
  1. 19
      chip-flash
  2. 4
      common.sh

@ -200,13 +200,14 @@ assert_error() {
if ${stage[0]}; then
echo == preparing images ==
prepare_images
prepare_uboot_script
if [ ! -f "${PADDED_UBOOT}" ]; then
prepare_images
fi
if [ ! -f "${UBOOT_SCRIPT}" ]; then
prepare_uboot_script
fi
echo == upload the SPL to SRAM and execute it ==
if ! wait_for_fel; then
echo "ERROR: please make sure CHIP is connected and jumpered in FEL mode"
fi
${FEL} spl "${SPL}"
assert_error 128
@ -236,7 +237,7 @@ if [[ "${METHOD}" == "fel" ]]; then
if ${stage[4]}; then
echo == upload ubi ==
${FEL} --progress write $UBI_MEM_ADDR "${UBI}"
${FEL} write $UBI_MEM_ADDR "${UBI}"
fi
if ${stage[5]}; then
@ -253,11 +254,13 @@ else
if ${stage[5]}; then
echo == creating sparse image ==
img2simg ${UBI} ${SPARSE_UBI} $((2*1024*1024))
if [ ! -f "${SPARSE_UBI}" ]; then
img2simg ${UBI} ${SPARSE_UBI} $((2*1024*1024))
fi
assert_error 133
echo == waiting for fastboot ==
if wait_for_fastboot; then
if wait_for_fastboot ${FASTBOOT_PORT}; then
fastboot ${FASTBOOT_PORT} -i 0x1f3a -u flash UBI ${SPARSE_UBI}
assert_error 134

@ -25,7 +25,7 @@ filesize() {
wait_for_fastboot() {
echo -n "waiting for fastboot...";
for ((i=$TIMEOUT; i>0; i--)) {
if [[ ! -z "$(fastboot -i 0x1f3a devices)" ]]; then
if [[ ! -z "$(fastboot -i 0x1f3a $1 devices)" ]]; then
echo "OK";
return 0;
fi
@ -41,7 +41,7 @@ wait_for_fastboot() {
wait_for_fel() {
echo -n "waiting for fel...";
for ((i=$TIMEOUT; i>0; i--)) {
if ${FEL} ver 2>/dev/null >/dev/null; then
if ${FEL} $1 ver 2>/dev/null >/dev/null; then
echo "OK"
return 0;
fi

Loading…
Cancel
Save