[Android Q&A, Help & Troubleshooting] m00cat:
Hi... I'm trying to be as concise and as detailed as possible here:

OK.. I'm trying to flash this ulefone S8 Pro with the STOCK ROM from the ulefone website. I'm using Debian Linux and the SP Flash Tool 5.1804.00 for Linux. I've disabled modemmanager (no conflict there) and I'm able to see from the logs that the device is recognised.

The device itself had it's stock boot.img flashed with a patched version (MagiskManager)and the boot loader has been unlocked - and all was working fine... someone decided to mess about deleting files from /system and the phone refused to boot.

So.... I took the device back and flashed boot, recovery and cache from the stock image using fastboot - all fine... then when it came to system.img - I found out that system-sign.img from the stock ROM wouldn't flash via fastboot - I got an error saying something along the lines of:

"Invalid sparse file format at header magi error: write_sparse_skip_chunk: ([I]I forget the size[/I]) is not a multiple of the block size 4096"

So, after a bit of googling - I was going to try the SparseConverter tool.. but this seemed to not like the system-sign.img and so I gave up on that idea..

Then I realize I probably need to be using the SP Flash tool - so.. I boot back into Linux and here's what happens.. When the phone is turned on.. I can hold power on + volume up to get the little menu (flashboot, recovery or normal boot) and it ignores this... it goes right to Recovery with "NO COMMAND" - no combination of button pushing does a thing... it will sit at no command, occasionally flashing the screen. When i plug it in.. and don't touch it.. same thing.. straight to no command.. when I turn it on (not plugged in) it does the same thing... when connecting to PC and SP Flash... I hit DOWNLOAD in SP FLASH and then with phone off (battery in) I connect it to the the PC and i get the red bar to 100% and then:

Connecting to BROM...
Scanning USB port...
Search usb, timeout set as 3600000 ms
add@/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/usb1/1-2

add@/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/usb1/1-2/1-2:1.0

add@/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/usb1/1-2/1-2:1.1

add@/devices/pci0000:00/0000:00:1c.3/0000:05:00.0/usb1/1-2/1-2:1.1/tty/ttyACM0

vid is 0e8d

device vid = 0e8d

pid is 2000

device pid = 2000

com portName is: /dev/ttyACM0

Total wait time = -1522456507.000000
USB port is obtained. path name(/dev/ttyACM0), port name(/dev/ttyACM0)
USB port detected: /dev/ttyACM0
BROM connected
Downloading & Connecting to DA...
connect DA end stage: 2, enable DRAM in 1st DA: 0
COM port is open. Trying to sync with the target...
Failed to Connect DA: S_BROM_DOWNLOAD_DA_FAIL
Disconnect!
BROM Exception! ( ERROR : S_BROM_DOWNLOAD_DA_FAIL (2004)

[H/W] Fail to download DA to baseband chip's internal SRAM!
[HINT]:
1. There's an cable communication problem between FlashTool and BootROM.
2. Target might be shutdown unexpectedly or target lost power supply.
[ACTION]
1. Try again.
2. Proceed H/W checking in download cable and target side com port.
3. Monitor if power-drop occured in target side.)((ConnectDA,../../../flashtool/Conn/Connection.cpp,146))

I've tried all USB ports. Various cables etc etc.. I've tried connecting with phone off and no battery (same thing - same output) - with the battery, without battery and putting battery in after connecting.. taking battery out and putting back in, pushing volume buttons on connecting USB... i've done it all.. same error all the time...

I'm almost to the point where I throw in the towel here... but I thought someone might have some clue or idea what to do now.

Any help appreciated.

Oh yeah.. lastly... dmesg | grep usb gives the following

[13640.521933] usb 1-2: New USB device found, idVendor=0e8d, idProduct=2000
[13640.521940] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[13640.521945] usb 1-2: Product: MT65xx Preloader
[13640.521949] usb 1-2: Manufacturer: MediaTek
[13643.171638] usb 1-2: USB disconnect, device number 13
m00cat@m00:~/Downloads$