[Sony Xperia XZ2 Questions & Answers] LaZiODROID:
Hello all. I'm having trouble flashing a stock rom on my Xperia XZ2. I believe this is a prototype phone (which could easily be the reason why but I don't know for sure - would appreciate it if anyone can share any insight)

I tried the easiest way first (Sony PC Companion) but it does not report any new update for this phone. The over-the-air check on the phone itself also reports that there are no updates.

Here is info about the unit:

Model: H8276

Android Version: 8.0.0

Build Number: 51.1.A.2.158

Crash Monitor, Crash Log Uploader, etc. apps are installed and can't seem to be disabled. They have persistent notifications that cannot be cleared (one of the main reasons I'd like to flash a normal FTF)

The phone isn't bricked or anything - it can be booted and used just fine.

Environment/prep:

Installed Sony & XZ2 drivers onto my Win7 machine

Installed Flashtool 0.9.25.0 (as i have read that lower versions will not work with this phone, and could possibly even brick it!)

Installed XperiFirm 5.3.7

What I have done so far:

I used Xperifirm to download and unpack an appropriate stock rom

("H8276_Bell Mobility CA_1313-8875_51.1.A.11.51_R12A")

I also did it again to get the "packed" version, just in case

Removed "fwinfo.xml" from the unpacked version. I read this on xperiablog.net, regarding creating your own FTF fw).

Removed "simlock.ta" from the unpacked version. I read this on talk.sonymobile.com forum - i don't want to risk sim-locking this phone (as I know it is currently sim unlocked)

Then in Flashtool, used the Create function and browsed to the Unpacked folder location and hit OK

Double-clicked the Device field and chose H82XX (Sony Xperia XZ2), then chose H8276

Typed Bell Mobility into the branding field

Typed 51.1.A.11.51_R12A into the Version field

Moved all the items from the 'folder list' on the left, into the 'firmware content' area on the right

Hit create - It asked "A FSC script is found: 51.1.fsc. Do you want to add it?" I hit yes (even though I don't know what it is... quick research showed that it shouldnt be bad or dangerous)

Waited a while for it to create - now I can see an FTF file has been created in \users\user\.flashtool\firmwares

Now, onto flashing:

In flashtool, I clicked the flash button

Chose Flashmode (not fastboot) method

I could see that the firmwares area on the left showed my new FTF - I broke down the tree to the version number and saw all the files appear in the Content area

I checked one box, which was USERDATA, under the Wipe area (assuming this will wipe userdata as part of the flash)

Then hit the FLASH button

Flashtool prepared and then asked me to connect the phone

With the phone off, I held the DOWNVOL button and plugged the USB cable in

I hear windows detecting the devices (like SOMC Flash Device, etc.) and the flashing begins

After a bunch of lines, I see a red ERROR one (will paste log below)

28/003/2018 15:03:59 - INFO - Selected Bundle for Sony Xperia XZ2(H8276). FW release : 51.1.A.11.51_R12A. Customization : Bell Mobility
28/003/2018 15:03:59 - INFO - Preparing files for flashing
28/004/2018 15:04:56 - INFO - Please connect your device into flashmode.
28/005/2018 15:05:18 - INFO - Using Gordon gate drivers version 3.1.0.0
28/005/2018 15:05:19 - INFO - USB buffer size set to 512K
28/005/2018 15:05:19 - INFO - Opening device for R/W
28/005/2018 15:05:19 - INFO - Device ready for R/W.
28/005/2018 15:05:19 - INFO - Reading device information
28/005/2018 15:05:19 - INFO - Reading phone properties
28/005/2018 15:05:19 - INFO - Sending getvar:max-download-size
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:version
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:version-bootloader
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:version-baseband
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:product
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:serialno
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:secure
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:Sector-size
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:Version-sony
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:USB-version
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:max-download-size
28/005/2018 15:05:19 - INFO - getvar status : OKAY
28/005/2018 15:05:19 - INFO - Sending getvar:Loader-version
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Phone-id
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Device-id
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Rooting-status
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Sector-size
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Ufs-info
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Emmc-info
28/005/2018 15:05:20 - INFO - getvar status : FAIL
[COLOR="Blue"]28/005/2018 15:05:20 - WARN - Emmc-info not supported[/COLOR]
28/005/2018 15:05:20 - INFO - Sending getvar:Default-security
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Platform-id
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Keystore-counter
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Security-state
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:S1-root
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Sake-root
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Battery
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Frp-partition
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Stored-security-state
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending getvar:Keystore-xcs
28/005/2018 15:05:20 - INFO - getvar status : OKAY
28/005/2018 15:05:20 - INFO - Sending Get-root-key-hash
28/005/2018 15:05:20 - INFO - Get-root-key-hash status : OKAY
28/005/2018 15:05:20 - INFO - Sending Read-TA:2:2202
28/005/2018 15:05:20 - INFO - Read-TA status : OKAY
28/005/2018 15:05:20 - INFO - Sending Read-TA:2:2205
28/005/2018 15:05:20 - INFO - Read-TA status : OKAY
28/005/2018 15:05:20 - INFO - Sending Read-TA:2:2210
28/005/2018 15:05:20 - INFO - Read-TA status : OKAY
28/005/2018 15:05:20 - INFO - Sending Read-TA:2:4900
28/005/2018 15:05:20 - INFO - Read-TA status : OKAY
28/005/2018 15:05:20 - INFO - Sending Read-TA:2:10021
28/005/2018 15:05:20 - INFO - Read-TA status : FAIL
[COLOR="Blue"]28/005/2018 15:05:20 - WARN - Unable to read TA unit 10021, error=-22 ( Hex unit value 00002725 )[/COLOR]
28/005/2018 15:05:20 - INFO - Connected device : H8276 / SW release 1313-2143_51.1.A.2.158 / Customization 1313-8875_R8A
28/005/2018 15:05:20 - INFO - Last flash date : null
28/005/2018 15:05:20 - INFO - Phone ready for flashmode operations.
28/005/2018 15:05:20 - INFO - Start Flashing
28/005/2018 15:05:20 - INFO - Parsing boot delivery
[COLOR="Red"]28/005/2018 15:05:20 - ERROR - Found no matching boot config. Aborting[/COLOR]
28/005/2018 15:05:20 - INFO - Sending Sync
28/005/2018 15:05:37 - INFO - Sync status : OKAY
28/005/2018 15:05:37 - INFO - Sending powerdown
28/005/2018 15:05:37 - INFO - powerdown status : OKAY
28/005/2018 15:05:42 - INFO - Device disconnected
28/005/2018 15:05:43 - INFO - Device connected in flash mode