[One (M7) General] adrenalize_:
[SOLVED] QSC Write Partition Error

OK, so I managed to get a partition table and dd images of every partition (well I didn't bother with mmcblkp40 the internal "SD" card) and the MBR from a very kind person who lent me their 802w for an hour or so and have managed to fix my phone:cool:

NOTE: This is for advanced users and you could easily completely brick your handset - do anything at your own risk)

As this isn't a common problem I'll try and be brief, but I have seen a few people with issues at the point QSC is written in either a "firmware.zip" flash or full RUU flash.

So I foolishly/stupidly:silly: flashed the x.xx.402.x KitKat firmware onto my 802w that was running x.xx.401.x happily and working. I also restored a TWRP backup of x.xx.402.x as it was purported to have slightly better network support and is ROM on the UK supplied One dual sims. However SIM2 lost 900MHz support so didn't work with several carriers in the UK - but 1800MHz still worked. Not ideal!!

So no bother I thought I'd just simply reapply the x.xx.401.x RUU as per that instruction in post #1 as I had done several times previously. However when the QSC part of the RUU was unzipped it would not write to the partition. I noted that the 402 firmware QSC version was E1237.29.35.0108 a much higher version than any other ROM I had seen and can only assume that there is some sort of version check that the bootloader does and would not write this partition effectively downgrading this. A newer version probably would not have been the problem had all the other partitions been flashed with an x.xx.402.x RUU, but as we know there is no x.xx.402.x RUU.

A lot of people suggested the partition sizes were incorrect. I don't believe this to be the case as all the partition entries on both the working and non-working phones were the same. The only partition difference was that /proc/emmc lists an additional named partition: mmcblk0p26: 00004000 00000200 "control" that was not present on the working 401 phone (well the partition was there but not listed in /proc/emmc). However the starting block, number of blocks etc was the same for mmcblk0p26 on both.

A few partitions contained reference to the QSC number and I tried editing them to a lower version, writing the partition back and flashing, but to no avail, still QSC WP error. Note at this point the bootloader screen always showed the higher 402 QSC version.

So I backed up all partitions of the good phone with dd using TWRP terminal prompt to SD and wrote them back to the faulty phone with the the exception of partitions 4,5,6,37 and 40 which either contained board info/serial number/IMEI, or recovery partition and the "SD card" partition. Now the bootloader shows the older version of QSC, the phone boots but SIM2 still no 900MHz. Interestingly in the info about versions menu the QSC version shows as the higher 402 version. Hmmm.

So I tried to flash the x.xx.401.x RUU again and holding my breath for ages the QSC partition writes successfully and the now 900MHz works on SIM2.

So I think that the bootloader prevents downgrading the QSC version, but can be made to think it has an older version and will then write it. In this case it is not that the partition sizes/layout is different - but mmcblk0p26 now being listed as "control" probably also is part of it.

It is clear that I had an unusual situation where some partitions were from one firmware and others from a different firmware. This may also be the case for others with QSC WP errors as I assume that OTAs and firmware.zip contents assume certain partitions pre-exist and don't need updating so aren't included and there is some version control of the QSC partition. I'm not entirely sure which mmcblk0p* partition QSC gets flashed to - I have a feeling it may have a holding mmc partition but is then flashed direct to the QSC chip which I believe is the Qualcom Single Chip used for the second SIM. (Mainly from observing that different partitions write at different speeds).

So if you can boot to bootloader / HBOOT and flash TWRP but your phone doesn't work and you get errors flashing RUUs then you can probably recover most phones if you have images of the good mmcblk0p*s. I may be able to assist if you have an 802w and need images of x.xx.401.x mmcblk0p*s;)