Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem flashing from Linux
#1
I received my Gemini today and after a few hours of testing it with Android I went on to try and flash the Debian TP to it - which is where I am stuck at the moment.

I have no Windows systems so I only used the Linux flashing tool.


As far as I can tell I've read all available resources on this, but this is the first Android device I tried to flash so it's likely I'm missing something.

I started out with the guide here: http://support.planetcom.co.uk/index.php/Flashing_Guide, with a scatter file generated by the partition tool as referenced from here: http://support.planetcom.co.uk/index.php...i_Firmware .

I started by trying to backup the NVRAM partition as in the guide above, and went exactly according to the instructions ('click the Read Back button, connect your Gemini to your PC and restart the Gemini')

Upon the reboot I got a 'BROM' error as mentioned at the beginning of the guide, so I continued by following the linked forum topic 'https://forum.xda-developers.com/general/rooting-roms/tutorial-how-to-setup-spflashtoollinux-t3160802/page16'.

This was on a Ubuntu 17.10 system.

After trying out the instructions from post https://forum.xda-developers.com/showpos...tcount=153 (both adding my user to the dialout group, and creating the udev users files) - with the difference that instead of downloading the logo file I always tested by trying to back up the NVRAM partition - with the same steps as above. I kept getting the same error. I also tried ideas posted later in that forum topic.

Note that I am not getting the same BROM error as mentioned in that post or the posts before it. I am getting:


Code:
USB port is obtained. path name(/dev/ttyACM0), port name(/dev/ttyACM0)
USB port detected: /dev/ttyACM0
Connect BROM failed: STATUS_ERR
Disconnect!
BROM Exception! ( ERROR : STATUS_ERR (-1073676287) , MSP ERROE CODE : 0x00.

This error was also encountered by an Arch user on the next page in the same forum topic, and the solution for him was apparently running as root. This did not work for me (tried both with sudo and running directly as root, as well as normal user - which should work since I added my user to the dialout group as mentioned above.

Following this I also tried all the same steps on another machine running Ubuntu 16.04 (where I added missing libpng to make the flash tool work) and on the original machine with Manjaro 17.1.10- where I used the Arch-specific instructions from the forum topic (Manjaro is derived from Arch).


I also tried using USB 2.0 port on my PC as it was mentioned WRT some other issue but I don't see how that would affect this.

I keep getting exactly the same error in all these attempts, so the problem is probably somewhere else.


Currently I'm still stuck at the point where I'm trying to readback the NVRAM partition, with the same error as above - did not try to flash anything yet.


Any idea what I'm doing wrong?
Reply
#2
BROM errors are usually solved by modifying the udev rules as specified here: https://forum.xda-developers.com/general...802/page16 - try inserting one rule at a time and see if this fixes your issue
Reply
#3
(05-26-2018, 10:19 AM)dguidi Wrote: BROM errors are usually solved by modifying the udev rules as specified here: https://forum.xda-developers.com/general...802/page16 - try inserting one rule at a time and see if this fixes your issue

As (chaotically) written in the above post, I did try creating those rules - and restarting udev - one at a time, and on both the Ubuntu and Manjaro systems - they did not affect the error at all. I do not think I am getting the same BROM error the people in that forum topic were getting.

However, I've also noticed the (first) post by gidds here: https://geminiplanet.com/2018/04/07/how-...omment-219

They are running into the same error, but no idea if they've solved it yet - so this is not an isolated case.

Also, to clarify, I'm using the current Android+rooted Android+Debian TP firmware for X27 linked from here: http://support.planetcom.co.uk/index.php...i_Firmware (I checked that my Gemini is an X27), and using the left USB-C port with the cable that came in the box.
Reply
#4
I managed to get around this, see https://www.oesf.org/forum/index.php?sho...t&p=286262 .

Differences from previous attempts:
- used Debian 9
- cloned and build the flash tool from source
- used only the second udev (20-mm-blacklist-mtk.rules) rule, not the first (previously I tried the first, then first + second)

Not sure which of these helped.
Reply
#5
(05-27-2018, 08:58 PM)kiith Wrote: I managed to get around this, see https://www.oesf.org/forum/index.php?sho...t&p=286262 .

Differences from previous attempts:
- used Debian 9
- cloned and build the flash tool from source
- used only the second udev (20-mm-blacklist-mtk.rules) rule, not the first (previously I tried the first, then first + second)

Not sure which of these helped.

Thanks for reporting this, It might be useful for other people facing the same issues.
Reply
#6
Hi — I'm the same ‘gidds’ as on GeminiPlanet &c.

I've had no luck at all flashing my Gemini, despite spending around 10 hours on this so far.  (You can imagine just how frustrating I'm finding all this…)

I don't have any machines running Windows or Linux, just a MacBook.  (Actually two, but one belongs to my employer.)  For various reasons, I don't want to set up dual-booting just to run the Flash Tool.  So I've been trying to run a Live version of Linux on a USB stick.

I eventually got the Flash Tool running in the latest Ubuntu, but it won't recognise my Gemini, so I haven't been able to read back the NVRAM.  (Gory details on the Gemini Planet page.)

I've tried multiple cables.  (The charging cable supplied with the Gemini, and a USB-3-to-USB-C cable.  I know they're OK, as I've used them with Android File Transfer on macOS.)

Seeing the comments above, I've also tried running the Flash Tool via 'sudo' (which failed; the window appeared, but was completely blank); and creating /etc/udev/rules.d/20-mm-blacklist-mtk.rules and then /etc/udev/rules.d/80-persistent-usb.rules (and restarting the udev service).  Still fails in the same way.

I've also tried to run the tool from Debian 9 Live, but had even less luck there.  The flash tool fails to run, complaining about a missing library.  (And I can't install that, as I haven't found a way to set up any network connections in Debian…)

So a version of the Flash Tool which ran on macOS would save people like me a huge amount of heartache!

Is there anything else I should try?

Do we know whether the Linux tool should work on MacBook hardware?  (Are there any hardware issues which would prevent it?)  And should it work from a Live version (on a USB stick)?

If so, can anyone confirm the exact sequence?  The Gemini takes over 30 seconds to boot from cold — at what point should it be connected?  (I've tried different points, but get either the BROM error, or no effect at all.)

Also, I've seen reports of problems caused by using rooted Android, e.g. if you then accept updates &c.  Are there any known issues there?

And is there any way of backing up my Gemini's settings and then restoring them into the rooted Android?  (Without signing in to Google.)
    Andy/
Reply
#7
(06-04-2018, 11:00 PM)gidds Wrote: Hi — I'm the same ‘gidds’ as on GeminiPlanet &c.

I've had no luck at all flashing my Gemini, despite spending around 10 hours on this so far.  (You can imagine just how frustrating I'm finding all this…)

I don't have any machines running Windows or Linux, just a MacBook.  (Actually two, but one belongs to my employer.)  For various reasons, I don't want to set up dual-booting just to run the Flash Tool.  So I've been trying to run a Live version of Linux on a USB stick.

I eventually got the Flash Tool running in the latest Ubuntu, but it won't recognise my Gemini, so I haven't been able to read back the NVRAM.  (Gory details on the Gemini Planet page.)

I've tried multiple cables.  (The charging cable supplied with the Gemini, and a USB-3-to-USB-C cable.  I know they're OK, as I've used them with Android File Transfer on macOS.)

Seeing the comments above, I've also tried running the Flash Tool via 'sudo' (which failed; the window appeared, but was completely blank); and creating /etc/udev/rules.d/20-mm-blacklist-mtk.rules and then /etc/udev/rules.d/80-persistent-usb.rules (and restarting the udev service).  Still fails in the same way.

I've also tried to run the tool from Debian 9 Live, but had even less luck there.  The flash tool fails to run, complaining about a missing library.  (And I can't install that, as I haven't found a way to set up any network connections in Debian…)

So a version of the Flash Tool which ran on macOS would save people like me a huge amount of heartache!

Is there anything else I should try?

Do we know whether the Linux tool should work on MacBook hardware?  (Are there any hardware issues which would prevent it?)  And should it work from a Live version (on a USB stick)?

If so, can anyone confirm the exact sequence?  The Gemini takes over 30 seconds to boot from cold — at what point should it be connected?  (I've tried different points, but get either the BROM error, or no effect at all.)

Also, I've seen reports of problems caused by using rooted Android, e.g. if you then accept updates &c.  Are there any known issues there?

And is there any way of backing up my Gemini's settings and then restoring them into the rooted Android?  (Without signing in to Google.)

Dear gidds,

SP Flash tool is a software provided by Mediatek and altough some parts are open source, it relies on a few libraries which are provided in binary format (for Windows and Linux, but not for Mac).

I understand you very well, as I also use a Mac as a main device...

While the Linux version is more complicated to get working as it depends on installed libraries and configuration, the Windows one is pretty straightforward, and the drivers work on pretty much any Windows version.

I will strongly suggest you to find a colleague or a friend with a Windows machine to do the flashing.

Regarding your other questions:

- I don't know of any incompatibility between Linux tool and the MacBook hardware

- The Gemini should connected when powered off to connect to the flash tool. If you see the Gemini starting, then the connection to the flash tool did not happen an d you need to restart your Gemini.

- Not sure what problems you are referring to when using a rooted android

- Also not sure about your other question
Reply
#8
Thanks for the reply, Davide.

In fact, I kept trying, and late last night I successfully flashed my Gemini!

The crucial bit seems to be running Debian 9, as it just doesn't work in Ubuntu.  (Not on my MacBook Pro, at least.  No idea why.)

So, for the record, here's my recipe for flashing a Gemini from a MBP:
  • Download an unofficial ISO of Debian 9 with the non-free additions (else wifi won't work; I got it from here).  Write it to a bootable USB stick (details here).
  • Download FlashToolLinux.tgz and Gemini_x27_10052018.zip from the Planet page, and write them to another USB stick.  (Don't extract them first, as the latter has a file that expands to over 4GB, which is too big for the fs.)
  • Boot into Debian from the stick.  (Boot with Alt held down, and select the right-hand drive.  Then, from the bootloader,  select the live version.  Once booted, set up wifi.)
  • Extract both files from the other stick directly to the Desktop.  (The latter extracts to around 7GB, so this presumes plenty of RAM!)
  • Find, download, and install libjpeg.so.8.  (I got libjpeg8_8d-1+deb7u1_amd64.deb and then ran ‘sudo apt install’ on that.)
  • Run flash_tool.sh (via sudo) to start the Flash Tool.
  • Select the relevant scatter file (in my case, Gemini_Android_Rooted.txt) in the ‘Scatter-loading File’ field.
First, take a copy of the Gemini's non-volatile RAM, which holds the IMEI &c, just in case:
  • Click the Readback tab.
  • Click the Add button.
  • Click the Read Back button.
  • Power down the Gemini completely.
  • Connect it (using the cable supplied with the Gemini, or any other USB-A-to-C data cable).
  • There's no need to boot the Gemini; within a few seconds of connecting, it buzzed and the tool showed it had read the NVRAM.
  • When done, the tool shows a little ‘OK’ dialog, which you'll need to press Esc to clear.
  • Disconnect the Gemini.  (Still off.)
  • That will have written a file called NVRAM0 (unless you changed it) to the FlashTool folder.  Take a copy for safety.
And to flash the Gemini:
  • Ensure you've backed up everything.  (This process can wipe all your apps, settings, files, &c.)
  • Ensure that the Gemini has plenty of battery left (they recommend at least 50%).
  • Return to the Download tab.
  • Select ‘Firmware Upgrade’ from the drop-down.  (At least, that's what I did.  If you're not changing the partitioning, e.g. replacing Android with rooted Android, then I think you can just leave it at ‘Download only’, which should preserve your apps and data.  But don't take my word for it — and always make sure you have backups!)
  • Click the Download button.
  • Ensure the Gemini is still powered off.
  • Connect the Gemini.  (Again, I didn't need to turn it on; the Flash Tool saw it was connected and then went through the whole process.  It takes a short while.  There's a progress bar on the bottom line.)
  • When done, it'll show another little ‘OK’ dialog, which you'll need to press Esc to clear.
  • Disconnect the Gemini (again, still off).
  • Boot it… but… very carefully…  (If it was wiped, it'll take you through all the welcome screens again, and you'll have to set it up from scratch.)
  • Finally, if you've installed rooted Android, install Magisk Manager and reboot to get root access.
Hope that helps anyone else!

Quote:- Not sure what problems you are referring to when using a rooted android

For example, how are firmware updates handled?  If the Gemini detects a firmware upgrade, is it safe to accept it?  (And if so, would that remove the root access?)

(As you can probably tell, I've never used Android before.  Until the Gemini, I've only had ‘dumb’ phones and my trusty Psion 5mx!)
    Andy/
Reply
#9
(06-08-2018, 03:49 PM)gidds Wrote: Thanks for the reply, Davide.

In fact, I kept trying, and late last night I successfully flashed my Gemini!

The crucial bit seems to be running Debian 9, as it just doesn't work in Ubuntu.  (Not on my MacBook Pro, at least.  No idea why.)

So, for the record, here's my recipe for flashing a Gemini from a MBP:
  • Download an unofficial ISO of Debian 9 with the non-free additions (else wifi won't work; I got it from here).  Write it to a bootable USB stick (details here).
  • Download FlashToolLinux.tgz and Gemini_x27_10052018.zip from the Planet page, and write them to another USB stick.  (Don't extract them first, as the latter has a file that expands to over 4GB, which is too big for the fs.)
  • Boot into Debian from the stick.  (Boot with Alt held down, and select the right-hand drive.  Then, from the bootloader,  select the live version.  Once booted, set up wifi.)
  • Extract both files from the other stick directly to the Desktop.  (The latter extracts to around 7GB, so this presumes plenty of RAM!)
  • Find, download, and install libjpeg.so.8.  (I got libjpeg8_8d-1+deb7u1_amd64.deb and then ran ‘sudo apt install’ on that.)
  • Run flash_tool.sh (via sudo) to start the Flash Tool.
  • Select the relevant scatter file (in my case, Gemini_Android_Rooted.txt) in the ‘Scatter-loading File’ field.
First, take a copy of the Gemini's non-volatile RAM, which holds the IMEI &c, just in case:
  • Click the Readback tab.
  • Click the Add button.
  • Click the Read Back button.
  • Power down the Gemini completely.
  • Connect it (using the cable supplied with the Gemini, or any other USB-A-to-C data cable).
  • There's no need to boot the Gemini; within a few seconds of connecting, it buzzed and the tool showed it had read the NVRAM.
  • When done, the tool shows a little ‘OK’ dialog, which you'll need to press Esc to clear.
  • Disconnect the Gemini.  (Still off.)
  • That will have written a file called NVRAM0 (unless you changed it) to the FlashTool folder.  Take a copy for safety.
And to flash the Gemini:
  • Ensure you've backed up everything.  (This process can wipe all your apps, settings, files, &c.)
  • Ensure that the Gemini has plenty of battery left (they recommend at least 50%).
  • Return to the Download tab.
  • Select ‘Firmware Upgrade’ from the drop-down.  (At least, that's what I did.  If you're not changing the partitioning, e.g. replacing Android with rooted Android, then I think you can just leave it at ‘Download only’, which should preserve your apps and data.  But don't take my word for it — and always make sure you have backups!)
  • Click the Download button.
  • Ensure the Gemini is still powered off.
  • Connect the Gemini.  (Again, I didn't need to turn it on; the Flash Tool saw it was connected and then went through the whole process.  It takes a short while.  There's a progress bar on the bottom line.)
  • When done, it'll show another little ‘OK’ dialog, which you'll need to press Esc to clear.
  • Disconnect the Gemini (again, still off).
  • Boot it… but… very carefully…  (If it was wiped, it'll take you through all the welcome screens again, and you'll have to set it up from scratch.)
  • Finally, if you've installed rooted Android, install Magisk Manager and reboot to get root access.
Hope that helps anyone else!

Quote:- Not sure what problems you are referring to when using a rooted android

For example, how are firmware updates handled?  If the Gemini detects a firmware upgrade, is it safe to accept it?  (And if so, would that remove the root access?)

(As you can probably tell, I've never used Android before.  Until the Gemini, I've only had ‘dumb’ phones and my trusty Psion 5mx!)

Dear Gidds,

Thank you for taking the time to post your reply, I'm sure it will help other people. 

Just for the record, I managed to get the flash tool working on Ubuntu, after a lot of thinkering with udev and with some other caveats.
And of course some users reported that the tool worked straight away on their Linux boxes...
Reply
#10
Hi,

I started to followed the instructions to backup the NVRAM information which failed with this error:

Code:
BROM Exception! ( ERROR : STATUS_PROTOCOL_ERR (-1073676283) , MSP ERROE CODE : 0x00.

   
Since then my gemini does not power on anymore, I am hoping its not bricked!  Full output from the command line is here:

Code:
jhendry@twigz ~/dev/gemini/FlashToolLinux/ $ sudo ./flash_tool.sh
libpng warning: iCCP: known incorrect sRGB profile
QMetaObject::connectSlotsByName: No matching signal for on_pushButton_browser_clicked()
QThread::setPriority: Cannot set priority, thread is not running
"06-19-2018"
libpng warning: iCCP: known incorrect sRGB profile
QObject::moveToThread: Cannot move objects with a parent
libpng warning: iCCP: known incorrect sRGB profile
Connecting to BROM...
Scanning USB port...
Search usb, timeout set as 3600000 ms
add@/devices/pci0000:00/0000:00:14.0/usb1/1-2

add@/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0

add@/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1

bind@/devices/pci0000:00/0000:00:14.0/usb1/1-2

add@/module/cdc_acm

bind@/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.1

add@/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/tty/ttyACM0

vid is 0e8d

device vid = 0e8d

pid is 2000

device pid = 2000

com portName is: /dev/ttyACM0

Total wait time = -1529482163.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
Failed to Connect DA: STATUS_PROTOCOL_ERR
Disconnect!
BROM Exception! ( ERROR : STATUS_PROTOCOL_ERR (-1073676283) , MSP ERROE CODE : 0x00.


[HINT]:
)((ConnectDA,../SP-Flash-Tool-src/Conn/Connection.cpp,131))
comboTimeout index(3) saved.



When I first connected the device dmesg recognised at as:

Code:
[ 1964.099253] usb 1-2: new high-speed USB device number 11 using xhci_hcd
[ 1964.248234] usb 1-2: New USB device found, idVendor=0e8d, idProduct=2000
[ 1964.248240] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1964.248243] usb 1-2: Product: MT65xx Preloader
[ 1964.248247] usb 1-2: Manufacturer: MediaTek
[ 1964.371647] cdc_acm 1-2:1.0: ttyACM0: USB ACM device
[ 1964.410364] usbcore: registered new interface driver cdc_acm
[ 1964.410365] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[ 1983.203287] cdc_acm 1-2:1.0: failed to set dtr/rts


Now it gets this error:

Code:
[ 2399.573301] usb 1-2: new high-speed USB device number 15 using xhci_hcd
[ 2404.713497] usb 1-2: device descriptor read/64, error -110


Any ideas what has happened or what I can do? This was done on Ubuntu 18.04 LTS using the Linux flashtool linked by gidds.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)