Bug fixes when flashing multiple chips

This commit is contained in:
Wynter Woods 2015-12-03 18:02:15 -08:00
parent 80e91d3e85
commit 63b98b6bc5
2 changed files with 13 additions and 10 deletions

View File

@ -200,13 +200,14 @@ assert_error() {
if ${stage[0]}; then if ${stage[0]}; then
echo == preparing images == echo == preparing images ==
prepare_images if [ ! -f "${PADDED_UBOOT}" ]; then
prepare_uboot_script prepare_images
fi
if [ ! -f "${UBOOT_SCRIPT}" ]; then
prepare_uboot_script
fi
echo == upload the SPL to SRAM and execute it == 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}" ${FEL} spl "${SPL}"
assert_error 128 assert_error 128
@ -236,7 +237,7 @@ if [[ "${METHOD}" == "fel" ]]; then
if ${stage[4]}; then if ${stage[4]}; then
echo == upload ubi == echo == upload ubi ==
${FEL} --progress write $UBI_MEM_ADDR "${UBI}" ${FEL} write $UBI_MEM_ADDR "${UBI}"
fi fi
if ${stage[5]}; then if ${stage[5]}; then
@ -253,11 +254,13 @@ else
if ${stage[5]}; then if ${stage[5]}; then
echo == creating sparse image == 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 assert_error 133
echo == waiting for fastboot == 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} fastboot ${FASTBOOT_PORT} -i 0x1f3a -u flash UBI ${SPARSE_UBI}
assert_error 134 assert_error 134

View File

@ -25,7 +25,7 @@ filesize() {
wait_for_fastboot() { wait_for_fastboot() {
echo -n "waiting for fastboot..."; echo -n "waiting for fastboot...";
for ((i=$TIMEOUT; i>0; i--)) { for ((i=$TIMEOUT; i>0; i--)) {
if [[ ! -z "$(fastboot -i 0x1f3a devices)" ]]; then if [[ ! -z "$(fastboot -i 0x1f3a $1 devices)" ]]; then
echo "OK"; echo "OK";
return 0; return 0;
fi fi
@ -41,7 +41,7 @@ wait_for_fastboot() {
wait_for_fel() { wait_for_fel() {
echo -n "waiting for fel..."; echo -n "waiting for fel...";
for ((i=$TIMEOUT; i>0; i--)) { 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" echo "OK"
return 0; return 0;
fi fi