Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[ZTE Open] fastboot flash not rebooting into bootloader

3,024 views
Skip to first unread message

Daniel Roesler

unread,
Oct 19, 2013, 2:50:47 PM10/19/13
to
Howdy all,

I am trying to build and install B2G onto my ZTE Open, following the instructions on https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Installing_on_a_mobile_device using Ubuntu 12.04.

However, I am getting a "No such device" error when flashing via flash.sh or manually (see below). I noticed after the "OKAY" after sending data the phone reboots. However it does not reboot into the bootloader, but rather normal mode.

After the flash fails, the phone does appear on "adb devices" but not "fastboot devices". Thus when fastboot tries to write, it can't find the device because the device did not reboot into bootloader mode.

How can I fix fastboot so that it correctly reboots into bootloader mode? Alternatively, is there a way to flash without the reboot? What steps can I take to troubleshoot this? Thanks!

Command outputs:
=========
$ ./flash.sh
< waiting for device >
erasing 'cache'...
OKAY [ 0.531s]
finished. total time: 0.531s
erasing 'userdata'...
OKAY [ 1.407s]
finished. total time: 1.407s
sending 'userdata' (49378 KB)...
OKAY [ 4.175s]
writing 'userdata'...
FAILED (status read failed (No such device))
finished. total time: 9.494s
=========

=========
$ fastboot flash system system.img
sending 'system' (111020 KB)...
OKAY [ 9.394s]
writing 'system'...
FAILED (status read failed (No such device))
finished. total time: 14.748s
=========

Daniel Roesler

Aaron Borden

unread,
Oct 20, 2013, 2:37:40 AM10/20/13
to Daniel Roesler, dev...@lists.mozilla.org
I ran into a similar problem. I realized that the fastboot device is
different from the adb device. If you check your dmesg you'll see two
different vendor strings. Make sure you have both vendors in your
android udev rules:

SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev" # ZTE Open
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev" # Google device

And then restart udev (or reload it's configs).

--
Aaron Borden
Human and Hacker


Daniel Roesler

unread,
Oct 20, 2013, 3:20:18 AM10/20/13
to Aaron Borden, dev...@lists.mozilla.org
Howdy Aaron,

Thanks for the reply. Unfortunately, I already have both vendor
strings in my udev.

$ cat /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"

And the device gets picked up by the appropriate interface when it
reboots (either into regular mode, or bootloader mode).

$ adb devices
List of devices attached
roamer2 device

$ adb reboot bootloader
<wait a few seconds>

$ fastboot devices
ROAMER2 fastboot

The initial fastboot flash command finds the device correctly when
"erasing" data, so I don't think it's a problem with the initial udev
setup.

Daniel Roesler

On Sat, Oct 19, 2013 at 11:37 PM, Aaron Borden <adbo...@a14n.net> wrote:
> On Sat, 2013-10-19 at 11:50 -0700, Daniel Roesler wrote:

Daniel Roesler

unread,
Oct 23, 2013, 5:10:10 AM10/23/13
to
I have been troubleshooting, and if I hold down the Vol Down button while the phone reboots during this flash command, it reboots to the bootloader (hooray!). However fastboot still fails because it doesn't wait long enough for the device to again be recognized by "fastboot devices".

When I watch the syslog (tail -f /var/log/syslog), I can see the usb device get disconnected, then reconnected a few seconds later. However, fastboot fails before the usb reconnects, so the timeout for waiting for the device to reconnect appears to be too short.

Has anyone been able to successfully flash a recovery.img or boot.img to their ZTE Opens? How did you get around this timeout issue?

Daniel

Eduardo González

unread,
Oct 23, 2013, 6:21:00 AM10/23/13
to
Hi Daniel. I recommend follows:
1. If your phone is purchased from eBay, upgrade with file downloaded from ztedevices.com in support area, selecting United Kingdom -> America Standard or Eurepean Standard . After upgrade fastboot is full enabled
2. If your phone is not from eBay, install CWM recovery (instructions from http://pof.eslack.org/2013/07/05/zte-open-firefoxos-phone-root-and-first-impressions/ )
3. Download upgrade as step 1 and change install script deleting first assert command. I have a post about it in Spanish: http://sl.edujose.org/2013/10/como-activar-el-fastboot-en-un-zte-open.html?m=1
4. In this point you must have fastboot full enabled. Then use the boot.img file as suggested in my post: http://sl.edujose.org/2013/10/adapted-boot-image-for-use-with-b2g.html?m=1
5. Finally run ./flash.sh and all will work correctly

Daniel Roesler

unread,
Oct 25, 2013, 4:54:43 AM10/25/13
to
Thanks for the response Eduardo!

Unfortunately, I get a verification failed error when trying to flash the ztedevices.com zip file in recovery mode (seems pretty common in other threads). When I try to flash your custom boot.img, I am still getting the "No such device" error described above.

However, I have gone into the actual fastboot source code and found the exact point where fastboot fails to flash the device:

In engine.c[1], fb_queue_flash() first sends the data to the device (line #383), then tells the device to flash the partition via a "flash:boot" or "flash:recovery" command (line #388).

However, when usb_write() and ioctl() are eventually called for the "flash:boot" or "flash:recovery" command in usb_linux.c[2] (line #363), this causes the device to reboot.

When the device reboots, it no longer has the same usb_handle as previously. Thus, when usb_read() tries to read the response of the usb_write() in usb_linux.c[2] (line #400), it can't find the cached usb_handle that has since changed. This is why I get a "No such device" error.

So, the real problem is why does sending a "flash:boot" or "flash:recovery" command to the device cause a reboot? Apparently, that's not supposed to happen. When fastboot sends other commands (like "getvar:max-download-size") it returns just fine.

Does anyone know the internals of the ZTE Open that might explain why those commands are causing reboots?

Thanks again,
Daniel

[1] - https://android.googlesource.com/platform/system/core/+/master/fastboot/engine.c
[2] - https://android.googlesource.com/platform/system/core/+/master/fastboot/usb_linux.c

werner....@gmail.com

unread,
Dec 15, 2013, 5:31:16 AM12/15/13
to
Hi Daniel,

I have the same problem with my zte open.
The fastboot command reboot my phone.
Do you have solve your problem ?

Daniel Roesler

unread,
Dec 18, 2013, 4:53:37 PM12/18/13
to werner....@gmail.com, Mozilla
I did, here's my bug report and solution:

https://bugzilla.mozilla.org/show_bug.cgi?id=928659#c2
> _______________________________________________
> dev-b2g mailing list
> dev...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-b2g
0 new messages