Razer Phone

I’m not one of those people that can buy a phone and start using it. I usually root my device and flash a custom ROM not long after I first turn it on. Where normal people can start using a new device immediately, it usually takes me a day or two before I can do the same, dealing with some weird edge case of missing documentation, just to get basic administration rights on my mobile device. Although Razer has official instructions for unlocking their devices1, and there are many third party guides, I attempted to avoid a critical step mentioned in their documentation. Even when I followed it, I still ran into problems, and found it fascinating that Razer devices can only be flashed via a USB 2.0 link. I’ve documented some of my error messages here, in case anyone is confounded by similar issues.

Razer phones use a multi-slot boot mechanism. This allows it to have two bootloaders, in case something goes wrong during a flashing process. I’ve had other photos with similar dual-recovery options, where the recovery ROM is typically selected by holding power and either up or down on the volume rocker switch to select either slot. With newer Android devices, this functionality can now be controlled in a standardized way using adb and fastboot. However, I ran into this issue where I could use adb shell getprop ro.boot.slot_suffix while the phone was running to get the current slot, but upon rebooting it into fastboot mode, I would get the following errors when trying to set the slot.

adb shell getprop ro.boot.slot_suffix
_b

adb reboot bootloader

fastboot --set-active=_a
fastboot: error: Device does not support slots

fastboot flash boot twrp-3.2.2-0-cheryl.img
fastboot: error: Failed to identify current slot

If I ignored the error and tried to flash twrp, I’d either get the Failed to identify current slot error listed above or the flash command would just hang indefinitely.

My current Linux distribution has outdated Android Platform tools, so I also tried updating to version 28.0.2, which is the latest as of the time of writing. I continued to get the exact same errors. Many of the guides mention using a Windows machine is best. I wondered if adb and libusb on Linux or Mac may have specific issues that are not present in the Windows drivers. On Windows I still had similar errors.

c:\Apps\platform-tools_r28.0.3-windows\platform-tools>fastboot.exe boot C:\Apps\twrp-3.2.2-0-cheryl.img
Sending 'boot.img' (23132 KB)                      FAILED (Write to device failed (Too many links))
fastboot: error: Command failed

c:\Apps\platform-tools_r28.0.3-windows\platform-tools>fastboot.exe flashing unlock
                                                   FAILED (Write to device failed (Too many links))
fastboot: error: Command failed

The official documentation states that using the USB-C cable that comes with the device is not recommended for flashing1. This is a bit misleading as the official documentation should clearly indicate that the build in cable will not work under any circumstances. Razer recommends using a USB-C to USB-A data cable, and I had one that came with a pair of headphones.

USB-C 3 to USB-A 3 Cable
USB-C 3 to USB-A 3 Cable

Unfortunately, this cable gave me the exact same errors. The issue is that this is a USB 3.1 USB-C to USB-A cable, preserving the USB3 protocol on both ends. After a lot of searching, I found a post by someone who had gotten similar errors and they were solved by using a USB-C to USB-A cable2. I wondered if the issue might be with USB3 connections themselves. Digging through my boxes of parts, I was able to find a USB2 hub and use it to link my phone to my Linux workstation. I reran the fastboot commands for booting twrp and it finally worked!

So in conclusion, in order to use flashboot with the Razer phone to load boot images, you must downgrade to a USB 2.0 connection. I have no idea what bizare voodoo the Razor developers decided to implement on their device which causes flashing to totally fail with USB3/C and only work via USB 2.0, but that’s what I concluded after over a day of frustration and debugging.