fastboot responds, except that it won't flash my recovery image


Question

I have installed Cyanogenmod (v13) on a Xiaomi Redmi 2 phone. So, it all worked, but then I tried a manual update.
I booted into recovery (TWRP), and flashed the new cyanogenmod ZIP file; then flashed the gapps ZIP file. But when I rebooted, I found two problems:




  • the device won't finish booting (gets stuck)

  • recovery mode is gone. If I try to boot into recovery, the Mi logo stays there forever



So, I could get into fastboot mode. Then I tried using the fastboot tool from a Linux PC.



The device responds properly:



# fastboot devices 
78768331 fastboot

# fastboot getvar version
version: 0.5
finished. total time: 0.003s

# fastboot oem unlock
...
OKAY [ 0.003s]
finished. total time: 0.003s

# fastboot erase recovery
erasing 'recovery'...
OKAY [ 0.041s]
finished. total time: 0.041s


But, when I try to flash a recovery image, it gets stuck:



# fastboot flash recovery cm-13.0-20160705-NIGHTLY-wt88047-recovery.img 
target reported max download size of 268435456 bytes
sending 'recovery' (11136 KB)...


I have tried this from two computers:




  • from a notebook, when I plug the device it is correctly recognized as a USB 2.0 device (syslog says it's a EHCI device), but no data is transferred. After some time, the kernel reports that "task fastboot blocked for more than 120 seconds" and prints a stacktrace to syslog.


  • from a desktop computer (also Linux), the device is only recognized as OHCI (USB 1.0), and no data is transferred. But in this case, unlike the notebook, when it tries to transfer, the keyboard stops functioning (OHCI, I suppose).




I also tried a Windows flashing program for Xiaomi devices, which I ran on Virtualbox, but it didn't recognize my phone.



What else can I try?


Answer

Fastboot is so unpredictable, ouch. Try the following steps.




  • Check if your cable is the stock one. If not, at least make sure it supports file transfer in fastboot mode.

  • Check that USB drivers are installed properly

  • Try to rename the recovery file to just "recovery.img", I know it looks stupid, but it did the trick for me.



Finally,

* the device won't finish booting (gets stuck)
* recovery mode is gone. If I try to boot into recovery, the Mi logo stays there forever

yeah, obviously it doesn't boot, you erased the recovery partition.



Also, I think for fastboot flashing isn't really needed to erase the partition you are going to flash.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes