-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gs5 fixes for Pit + flash #225
base: master
Are you sure you want to change the base?
Conversation
Quick tested on the SM-G900F (S5 klte) the print-pit and flash commands. Both are working now using your patchset. |
@sshimko Thanks for the patch! I've been meaning to look into this and was hoping to do so this week-end. So it looks like you've saved me some of the work. However, I can't go ahead and merge this patch in its current state as you've commented out some code and also made some superfluous (and slightly incorrect) changes to the error messages. The patch is still very helpful though. Which of the following would you prefer:
No. 2 is more straight-forward for me, but it means you wouldn't get your name in the commit history - your call. |
Default parameter values in SendPacket and ReceivePacket were leading to confusion in the ReceivePit function. Empty transfer flags were passed in as timeouts. Additionally, on the GS5, empty transfers aren't required around the send ack packets during Pit retrieval, and actually screw up the state breaking the remainder of the session.
@Benjamin-Dobell I pushed an update that drops two of the commits and contains just the functional fixes. I should have split out the comment and err message changes etc after I referenced specific issue numbers. I do think some are useful but I'll do a another pull request so those can be discussed there. I'd prefer option 1 BTW :) |
@sshimko Thanks for that. I'll have to do some testing on some of the older devices I have access to; but otherwise I'm happy with how the patch looks and I'll gladly merge it. |
thank you for submitting this patch @sshimko, will merge and test |
@sshimko I've tested this across all the devices I have access to. It does not cause problems for older devices but breaks support for the SM-N900 (International Note 3). Unfortunately I don't have an S5 at this point, which will make further investigation difficult. However, I'll see what I can come up with. |
@Benjamin-Dobell I should have access to that Note 3 tomorrow and can also regression test against an S5. What firmware version? What operation were you performing? Anything interesting in the logs? |
@sshimko the hlte needs to have taken a 4.4 OTA from Samsung to be impacted best I can tell, firmware level depends on which hlte you have but any 4.4 firmware level should work to test with. |
@utkanos @Benjamin-Dobell I just tested it on a N900V w/ 4.4.2 hlte firmware and it is working for me. Any other info llike logs would be greatly appreciated. |
FYI, I can flash firmware to my G900F with this patch, but still get lots of
warnings. (Thanks a lot for this - I've had my smartphone softbricked and had no Windows PC around..) |
This patch worked for me on an SM-G900F with no apparent problems. |
Another vote for merging this patch - couldn't flash my G900A without it, worked like a charm after pulling this and recompiling. |
While this patch works for me on a SM-G900F it seems to break PIT download Note that heimdall from master works for me on this device. Here is the log:
|
This fixes functionality on the trltetmo (T-Mobile Note 4) without the need for the CM instructions to disable a bunch of USB interfaces (which is a terrible idea) |
Off topic: Cool my VZW Note 4 should be here in the next few days :) |
I tried this patch after seeing it referenced in #241 and this is what I get with this patch:
Same for a flash attempt. |
The first error you posted in #241 appears to be before this patch, and this one that is posted both here and in #241 appears to be the phone not being detected as connected in bootloader mode. Did you make sure to put the phone into bootloader mode THEN connect it to USB and attempt to flash? A common issue is having the phone connected before entering bootloader and the system considers the USB port occupied and doesn't flush the current driver to load the new one. |
Yup, lsusb showed:
You can see it's in download mode there. And yes, it's an S5, not an S2. :) Verizon, if it matters. FWIW, I merged this and #240 onto master since both seem to have fixes for this (the one line that conflicted I took from the other PR), and it still didn't work. Also, in download mode it says that the produce name is SM-G900V, as expected. |
Also, I printed out the actual result from But, interestingly if we don't setup the interface alt setting (I comment out that call), it gets much further:
|
But I can't flash using that, I get:
|
Even with this patch, I could not flash twice back to back. I did not use the other patch you referenced, though. I'm not sure if my setup will help since it is a Mac and a Note 4, neither of which match up to yours. |
I seem to have having slightly different problems. I'll open up a separate issue. |
Actually, trying a different machine let me get past the other issues I was seeing and now I got the issue described by here and I get the |
I've resorted to |
I tried the patch and it worked with download-pit and print-pit, BUT i have to disconnect the USB-cable afterwards and reconnect. Device: |
@locomanolo disconnect and reconnect at which point in the process? |
@sshimko Every time i did a download-pit or print-pit. But now i guess, it's because i didn't set the --resume flag. So i tested with --resume flag and replugging didn't help. Just look at the log for more details. And again, just to clarify. My guessing about the --resume flag was wrong, but lead me to another error. I can download-pit or print-pit with the command 'sudo heimdall download-pit --output pit --no-reboot --verbose', if i disconnect and then connect the USB-cable after each command. But replugging the cable doesn't work with the command ''sudo heimdall download-pit --output pit --no-reboot --verbose --resume'. Therefore, i think it has to do with the initialisation of the USB-connection. Log:
Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna This software is provided free of charge. Copying and redistribution is If you appreciate this software and you would like to support future Initialising connection... Initialising protocol... Beginning session... Some devices may take up to 2 minutes to respond. Session begun. Downloading device's PIT file... Ending session...
Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna This software is provided free of charge. Copying and redistribution is If you appreciate this software and you would like to support future Initialising connection...
iMan:iProd:iSer: 1:2:0 interface[0].altsetting[0]: num endpoints = 1 interface[1].altsetting[0]: num endpoints = 2 Initialising protocol... Releasing device interface... ########################
Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna This software is provided free of charge. Copying and redistribution is If you appreciate this software and you would like to support future Initialising connection...
iMan:iProd:iSer: 1:2:0 interface[0].altsetting[0]: num endpoints = 1 interface[1].altsetting[0]: num endpoints = 2 Initialising protocol... Beginning session... Some devices may take up to 2 minutes to respond. WARNING: Empty bulk transfer after sending packet failed. Continuing anyway... Downloading device's PIT file... Entry Count: 30 --- Entry #0 --- --- Entry #1 --- --- Entry #2 --- --- Entry #3 --- --- Entry #4 --- --- Entry #5 --- --- Entry #6 --- --- Entry #7 --- --- Entry #8 --- --- Entry #9 --- --- Entry #10 --- --- Entry #11 --- --- Entry #12 --- --- Entry #13 --- --- Entry #14 --- --- Entry #15 --- --- Entry #16 --- --- Entry #17 --- --- Entry #18 --- --- Entry #19 --- --- Entry #20 --- --- Entry #21 --- --- Entry #22 --- --- Entry #23 --- --- Entry #24 --- --- Entry #25 --- --- Entry #26 --- --- Entry #27 --- --- Entry #28 --- --- Entry #29 --- Ending session... ############
Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna This software is provided free of charge. Copying and redistribution is If you appreciate this software and you would like to support future Initialising connection...
iMan:iProd:iSer: 1:2:0 interface[0].altsetting[0]: num endpoints = 1 interface[1].altsetting[0]: num endpoints = 2 Beginning session... ############
Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna This software is provided free of charge. Copying and redistribution is If you appreciate this software and you would like to support future Initialising connection...
iMan:iProd:iSer: 1:2:0 interface[0].altsetting[0]: num endpoints = 1 interface[1].altsetting[0]: num endpoints = 2 Beginning session... ############
Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna This software is provided free of charge. Copying and redistribution is If you appreciate this software and you would like to support future Initialising connection...
iMan:iProd:iSer: 1:2:0 interface[0].altsetting[0]: num endpoints = 1 interface[1].altsetting[0]: num endpoints = 2 Initialising protocol... Releasing device interface... ############
Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna This software is provided free of charge. Copying and redistribution is If you appreciate this software and you would like to support future Initialising connection...
iMan:iProd:iSer: 1:2:0 interface[0].altsetting[0]: num endpoints = 1 interface[1].altsetting[0]: num endpoints = 2 Initialising protocol... Beginning session... Some devices may take up to 2 minutes to respond. WARNING: Empty bulk transfer after sending packet failed. Continuing anyway... Downloading device's PIT file... Ending session... |
I was also having the "Empty bulk transfer" problems with the SM-G900F using the 1.4.1. I built the master branch (at d0526a3) and was able to flash on the recovery without issues. (Running on Fedora 21) |
Is there a EASY answer to how you fix this: |
Is the fix integreated in the version 1.4.0 ? This version end with the same error (SM-G900F, Vodafone-branding):"... Session begun. Downloading device's PIT file... ..."Or the software must be manually edited with the fix? But how? |
I'll just add that with a Galaxy S5 Canadian version (SM-G900W8), sshimko's patch fixed this issue for me. |
Is this ever getting pulled? |
@Qwertie- As is, no. Because I've confirmed this change breaks support for other devices - further investigation is needed. However, so that other people can benefit, I leave pull requests open until I can come up with a better solution - right now I don't have a better solution. |
@Benjamin-Dobell I built the latest version and it works on my SGS 5 but the binary on the website does not with the error
|
@jaymzh @benwaffle Your |
@sshimko @Benjamin-Dobell S5 users on OSX are hosed without getting something into the latest version of heimdall from this fix fork. |
@shellscape Unfortunately I can't merge this (as is) due to it breaking support for SM-N900, and possibly other devices I don't own. However, you have two options:
At line 929 of BridgeManager.cpp (https://github.com/Benjamin-Dobell/Heimdall/blob/master/heimdall/source/BridgeManager.cpp#L929):
Ideally we could detect SGS5 and just toggle between these two behaviours at run-time. However, some SGS5 definitely do work - as I have a GM-G900I that works flawlessly. I suspect this behaviour changes between secondary bootloader versions - so knowing the device model may not be enough to differentiate. |
@Benjamin-Dobell awesome info, thanks much for taking the time to post that. I'll give that a shot in the next day or so. I'm running a very old KitKat bootloader, and I've suspected that my problems getting it updated are related to it's age. |
Doesn't look like that worked, unfortunately. I made the suggested change and built the source, and using that binary I attempted to flash - which appeared to work successfully. However, I checked after boot and despite there being no error messages, no changes were made. I attempted to download the pit file from my SM-G900T and this is what I got:
|
It looks like you're still running the old binary. If you're running the latest code from this repo it will say v1.4.1. |
You're too fast :) I copied an older log I had generated by mistake. I updated the output in the previous comment that was generated from using the built binary. |
Hmm, it's failing very early on - this patch modifies functionality during PIT dumping, but you're not even able to connect. I suggest opening or commenting on another issue. However, in my experience if it fails that early on it usually means you've failed to communicate with the device once (say using the old binary), and then haven't rebooted the device (back into download mode) before trying again. Please ensure you've freshly rebooted into download mode before running Heimdall. The same error can also occur due to a slightly dodgy USB port or cable, in download mode the devices seem to be particularly fragile and fail with ports and cables that work fine with other devices. So it's worth trying another port as well. |
You were indeed correct on the reboot suggestion. I hadn't realized, noob mistake there, so apologies are due. I attempted a PIT download (after rebooting into download) and this is the output:
The resulting G900T.pit file is 0 bytes. |
Unfortunately, I'm not sure; without the device on hand it's really difficult for me to resolve these types of issues. I only have access to a G900I, and it actually works without this patch applied. If you haven't already done so, then I would suggest undoing the change you made to |
@Benjamin-Dobell thanks for the help none the less. I recloned the repo and rebuilt, but I'm still getting the the |
@sshimko thank you, it's work for me, not galaxy s5 but sc-02f which use android 5.0 bootloader |
Current git on 2016-08-12 built on Debian jessie worked for me on a Samsung S5 SM-G900T to RECOVER twrp-3.0.2. |
Just another report that this patch, applied on top of the v1.4.1 tag, plus the fix from #172 (comment), was enough for me to flash TWRP on my T-Mobile Galaxy S5 using Ubuntu 12.04. |
I merged this with master, resolved the conflict and can confirm it fixes the issue for Note 2014 LTE. I created #373 to merge into master. |
I'm getting "SECURE CHECK FAIL" on flashing, probably because my image is bad... and I tried adding the two other arguments to the ReceivePitFile SendPacket and I think it may have messed things up for my Galaxy J727U |
I just tried this commit on the GS5 G900T and was able to finally get a copy of the PIT. |
There are problems on the GS5 when sending empty bulk transfers during Pit file packet requests.This put the entire session into a wonky state. Request none be sent for these packets.