[Solved] Several (related) problems flashing anything but stock

Linwood.Ferguson

Senior Member
Oct 16, 2010
170
31
0
I have a C6506 that is unlocked, have checked via the service code. Not just unlockable but unlocked. Certain.

I've used both older flashtool64 that worked before (0.9.11.0) on a Surface Pro (windows 10) and newer (0.9.19.10) on a desktop (Windows 10 also).

In both cases I can flash 10.7.a.0.222 for C6506. I also can flash 10.3.a.0.423 on the Surface (did not try on others). It boots, it works, no issues.

I can get in fastboot mode on the phone (blue light), but on the surface with the older Flashtools (and associated drivers) I cannot access the phone at all, just waiting for device.

On the newer flash tools with drivers installed (turned off signing verification) I can get into fastboot and do things like a "getvar version", but I cannot do more complex things like get the unlock status, nor can I flash a boot image (in this case from CM 12.1). It says "Command not allowed" in the write phase. Yes, the phone is unlocked, really, at least it says it is, and I did do an unlock code with legitimate Sony provided codes. And previously rooted using it as unlocked.

I've also tried getting root with a pre-rooted 10.7.a.0.222 -- I can get an older version rooted, put recovery on it, I can do the install of the zip and it completes -- then boot loop. This is using Beta-SuperSU-V2.52.zip and zl-lockeddualrecovery2.8.23-release.combined.zip with PRFCreator. (The recovery is also what I used to do the install). Boot loop. Can't get out of it without a new flash despite power off, resets, etc. Can't get back into recovery either at that point.

I do have the phone working with a non-rooted stock Sony 10.7.A.0.222. As mentioned, flashes fine. I just can't seem to get CM running (can't fastboot the boot image), nor can I get root on the stock sony (boot loop).

I've also tried the fastboot program on the current SDK as well as the one in Flashtools without any difference, still can't flash a boot.img from cm12.1.

I feel like I'm missing something fundamental, like maybe some aspect of running Windows 10 that is interfering (I have no older version currently). I'd suspect CM12.1 but it also is failing with the typical root technique for 5.1.1 stock (i.e. root older version first).

While I am not an active developer, this is not my first round of flashing or updating the phone, though it is my first round in a year or more, certainly since Windows 10.

I realize this is a lot like "nothing is working what could be wrong" and not a very specific question, but wondering if anyone has any suggestions as to whether there might be a common cause here.
 
Last edited:

Linwood.Ferguson

Senior Member
Oct 16, 2010
170
31
0
I do have one more interesting piece of information that I do not understand.

I downloaded Emma and tried to use it to flash stock just to make sure the image I had was good for stock.

Emma says "this phone is locked". So thinking my last flash re-locked it, I went into flash tools and did this:

U:\AndroidSDK\platform-tools>fastboot oem unlock 0xkey-from-sony
...
OKAY [ 2.969s]
finished. total time: 2.969s

After doing so, Emma STILL says it is locked.

Flash tool however allows me to flash it.

Any clue why Emma would say "locked" when I just finished unlocking it?

In service, configuration it says "Yes" to unlocked, not "no/yes" or any other combination, just "yes".
 

ham5

Senior Member
Mar 24, 2014
128
28
0
focus on getting the sdk tools to work, like fastboot. What do you mean it just does not flash( show console output of your fastboot flash boot boot.img), Is fastboot not recognized in the device manager, It is odd you can use it to 'oem unlock'... I had to change driver files when I switched from windows 7 to windows 10. if you can 'fastboot devices' and 'adb devices' you should be good to go as far as flashing, maybe you have bad images not made for the phone? I am no pro take my information with a grain of salt.
 

Linwood.Ferguson

Senior Member
Oct 16, 2010
170
31
0
focus on getting the sdk tools to work, like fastboot. What do you mean it just does not flash( show console output of your fastboot flash boot boot.img), Is fastboot not recognized in the device manager, It is odd you can use it to 'oem unlock'... I had to change driver files when I switched from windows 7 to windows 10. if you can 'fastboot devices' and 'adb devices' you should be good to go as far as flashing, maybe you have bad images not made for the phone? I am no pro take my information with a grain of salt.
I will try again tomorrow (need the phone tonight and it takes a while to get stock back up and configured).

Concentrating on fastbook and on my more-working desktop (the tablet definitely has some issue, I think driver related).

I installed the newest Flashtools, and also installed the fastboot and s1 drivers from it (I think that's what they are called). I configured Windows to permit them unsigned and they installed without error.

When I try to do CM12.1, what I did was download their distribution zip, and unzip it and pull out the boot.img file. I then put the phone in fastboot mode, and it worked and was recognized (e.g. "fastboot getvar version" responds).

Going by the instructions for CM12.1, I then tried to do "fastboot flash boot c:\pathwhereitwas\boot.img"

This does a send of the file, which works, and then does a write and says "command not allowed". So it appears to transmit the file but can't commit it to flash. I cannot post the log as didn't save it but if you think relevant can post tomorrow.

As to the locked issue -- after trying this the first time, I thought "maybe the phone has been locked again". So I did the #*#*service*#*# and see it says "yes" for unlocked. But just to be safe, I dug out my 2 year old email from Sony and did another unlock. As to why I did it with the "oem unlock" that's how CM12.1 suggests (https://wiki.cyanogenmod.org/w/Install_CM_for_odin). The first time I typed it, it failed, the second time it said "OK". Tried the flash boot again, same "command not allowed error".

The phone goes into fastboot mode easily (blue light, plus response to things like getvar). It goes into flash mode fine also, and indeed, after I gave up (each of several times) I flashed stock back on the phone and it came up with 5.1.1 stock.

I wanted to run CM12.1 as I really don't like that stock has not patched stagefright, plus I hate not having root.

Any suggestions what I may be doing wrong, that fastboot commands sometimes work, but I can't flash the boot file?

Am I flashing the RIGHT boot file? Should I be flashing the CM12.1 recovery image they have on their download page instead? (But the instructions are pretty clear).

I should note that the phone does not appear to have a recovery on it -- booting after flashing stock, and toggling all the volume buttons in any combination is just ignored.
 

ham5

Senior Member
Mar 24, 2014
128
28
0
I think your really digging way to deep into this...

The phone goes into fastboot mode easily (blue light, plus response to things like getvar). It goes into flash mode fine also, and indeed, after I gave up (each of several times) I flashed stock back on the phone and it came up with 5.1.1 stock.
what is the difference between fastboot and flash mode? Ive never heard of this flash mode....

This does a send of the file, which works, and then does a write and says "command not allowed". So it appears to transmit the file but can't commit it to flash. I cannot post the log as didn't save it but if you think relevant can post tomorrow.
I don't believe it sends a file at all, it is flashed/written to the boot partition right away.. or is supposed to - I would consider this your chief complaint... "command not allowed" when trying to fastboot flash a boot.img -- I get a lot of hits googling that.. driver problems/bootloader locked
 

Linwood.Ferguson

Senior Member
Oct 16, 2010
170
31
0
I think your really digging way to deep into this...
I'd welcome a shorter, simpler path.
what is the difference between fastboot and flash mode? Ive never heard of this flash mode....
Perhaps it is purely a sony thing. If, with the phone powered off, you plug it in holding the volume up button you end up in fastboot mode; if you plug it in with the volume down you end up in flash mode.

Flashmode is used by Emma and by Flashtools. Fastboot is used by the Fastboot utility. I'm unclear what happens under the cover, but they are not interchangeable.

I don't believe it sends a file at all, it is flashed/written to the boot partition right away.. or is supposed to - I would consider this your chief complaint... "command not allowed" when trying to fastboot flash a boot.img -- I get a lot of hits googling that.. driver problems/bootloader locked
As I said, I do not know what happens under the covers, but in fastboot mode when you do the "flash boot" it first says it transmitted a file (shows bytes sent, etc) then it does a "write" command itself and it is that write command that fails.

And therein lies my issue trying to flash the boot image -- the write command fails, and I cannot figure out why.

Drivers: I've tried the latest flashtool, and installed the drivers from there. They do install (with signing verification off), and they do connect and see the phone. Some commands work, but this one does not. Could it be the drivers? Certainly, but I do not know what to try to fix them.

Emma: I hate to keep coming back to this, but I do not understand why Emma says my phone is locked, when it clearly appears not to be. I've both re-unlocked it, confirmed it is unlocked with the service menu. But that it thinks it is locked, and the "write" command failure, makes me wonder if there is an issue either in the phone or windows or drivers that makes it act that way. incidentally I've also tried all this with antivirus/firewalls off with no effect.

Locked: just to confirm, in the service menu it says "Root Status" and "unlockable" as "yes". Not "Yes/no". That means it is currently unlocked, correct?

To your first point, I may be over-complicating it. I would welcome some suggestion of other simpler steps. I've done the same google, and don't see real solutions other than "try better drivers", but most threads seem to point to the flashtools drivers, and I've tried those, as well as installing Emma which (presumably) either used those or loaded its own.
 

Linwood.Ferguson

Senior Member
Oct 16, 2010
170
31
0
Incidentally if this is more appropriate to the Q&A forum, and a moderator is handy, I would appreciate it moving. I placed it here because this relates mostly to the Flashtools drivers and the process of using fastboot.
 
  • Like
Reactions: Toledo_JAB

ham5

Senior Member
Mar 24, 2014
128
28
0
I cant say for sure .. CM's dialer does not work with service menu... but you defiantly not worried about root... your looking for the bootloader to be unlocked, not unlockable..
 

Linwood.Ferguson

Senior Member
Oct 16, 2010
170
31
0
I cant say for sure .. CM's dialer does not work with service menu... but you defiantly not worried about root... your looking for the bootloader to be unlocked, not unlockable..
I've never gotten to CM on this phone so that's moot. I'm doing the service menu from the stock phone. And so far as I can tell the bootloader is unlocked.

I went back to a much older version of Flashtools (0.9.11) that dates from about the time I got the phone, but those drivers do not seem to install on Windows 10 at all.

But I'm not clear whether it is a driver problem, since some fastboot commands work fine.
 

Linwood.Ferguson

Senior Member
Oct 16, 2010
170
31
0
Just read using emma with lollipop can screw your phone up... in fastboot mode can you 'fastboot getvar version' ?

here is the CM wiki - https://wiki.cyanogenmod.org/w/Install_CM_for_odin - good luck I don't think I can be of any help.
Yes, in fastboot mode I can do the getvar version. It says 0.5.

I had read the wiki; as mentioned that is why I was trying to flash boot.img.

As requested here is a fastboot session log:

Code:
U:\AndroidSDK\platform-tools>fastboot getvar version
version: 0.5
finished. total time: 0.002s

U:\AndroidSDK\platform-tools>fastboot flash boot boot.img
sending 'boot' (10668 KB)...
OKAY [  0.340s]
writing 'boot'...
FAILED (remote: Command not allowed)
finished. total time: 0.340s

U:\AndroidSDK\platform-tools>fastboot flashing get_unlock_ability
...
^C
U:\AndroidSDK\platform-tools>fastboot devices -l
EPxxxxx47K             fastboot

U:\AndroidSDK\platform-tools>fastboot devices
EPxxxxx47K      fastboot

U:\AndroidSDK\platform-tools>fastboot flash boot boot.img
sending 'boot' (10668 KB)...
OKAY [  0.340s]
writing 'boot'...
FAILED (remote: Command not allowed)
finished. total time: 0.354s

U:\AndroidSDK\platform-tools>fastboot flash boot boot.img
sending 'boot' (10668 KB)...
OKAY [  0.340s]
writing 'boot'...
FAILED (remote: Command not allowed)
finished. total time: 0.353s
As you can see some commands work, some do not. Not sure the get_unlock_ability is even supposed to work as it looks like a late comer to fastboot and the phone is old.

Most articles I find posted about "command not allowed" do not seem to get as far as being able to use fastboot at all, but even if it is a driver issue, not sure what I can do about it, these are the latest drivers.
 

Linwood.Ferguson

Senior Member
Oct 16, 2010
170
31
0
Ok, I've managed to get this to work. I can tell you what I did, but not why, but in case it helped someone else.

The bootloader showed unlocked, but I ran the flashtool option to unlock it again, then WITHOUT REBOOTING I did the fastboot option to flash the boot.img.

It appears that if you reboot (to stock) in between, it does something that at least makes it appear the bootloader is locked (the service menu shows it NOT locked still).

There's another thread here that implies you need to do it multiple times, but I think the issue is not a need to do it more than once, but a need to make sure that (at least a late version stock) does not get a chance to run, as it appears to do something.

I'm now happily on 12.1. Well, sort of happy, I finally noticed it says it doesn't support the 6506 (as opposed to the 6503) so I might not stay long, but at least I worked out what was wrong. Thanks to those who encouraged me to keep looking.
 
  • Like
Reactions: bam80