MTK-bypass / bypass_utility

MIT License
460 stars 114 forks source link

Unexpected output, expected 0xfd got 0xa0 #53

Open Tooniis opened 2 years ago

Tooniis commented 2 years ago

Trying to run this on a MT6737T device (Galaxy Grand Prime+), and I'm getting this:

$ ./main.py
[2021-08-31 07:26:26.592030] Waiting for device
[2021-08-31 07:26:32.107721] Found device = 0e8d:2000
Traceback (most recent call last):
  File "/home/$USER/Code/Source/bypass_utility/./main.py", line 237, in <module>
    main()
  File "/home/$USER/Code/Source/bypass_utility/./main.py", line 42, in main
    config, serial_link_authorization, download_agent_authorization, hw_code  = get_device_info(device, arguments)
  File "/home/$USER/Code/Source/bypass_utility/./main.py", line 160, in get_device_info
    hw_code = device.get_hw_code()
  File "/home/$USER/Code/Source/bypass_utility/src/device.py", line 265, in get_hw_code
    self.echo(0xFD)
  File "/home/$USER/Code/Source/bypass_utility/src/device.py", line 176, in echo
    self.check(from_bytes(self.read(size), size), words)
  File "/home/$USER/Code/Source/bypass_utility/src/device.py", line 132, in check
    raise RuntimeError("Unexpected output, expected {} got {}".format(gold, test))
RuntimeError: Unexpected output, expected 0xfd got 0xa0

There's this line in lsusb:

Bus 001 Device 009: ID 0e8d:2000 MediaTek Inc. MT65xx Preloader

I'm using the patched kernel from https://github.com/amonet-kamakiri/prebuilt-kernels/tree/master/arch

Tooniis commented 2 years ago

Apparently it was booting into the preloader. There seems to be no button combination (including not pressing anything) to make it boot to the boot ROM, so I crashed it into BROM with this https://github.com/cyrozap/mediatek-lte-baseband-re/blob/master/SoC/common/usbdl.py and it worked afterwards.

Doesn't bypass_utility also have a crash_preloader function to do this? Why isn't it being called in this case?

halitoff commented 2 years ago

so I crashed it into BROM with this

Can you help me with it? I flashed wrong preloader and now my phone don't want to flash

lucaslira95 commented 2 years ago

Still having the same error here

s-b-repo commented 6 months ago

same for me but on redmi 9c on windows

s-b-repo commented 6 months ago

It looks like there's an issue in your Python script, specifically in the "get_hw_code" method of the "device.py" module. The error is indicating that the script expected to receive the hexadecimal value 0xFD but instead received 0xA0.