yashsingh1/xdaforums huggingface dataset:
[Epic 4G Android Development] LiberatorUSA:
I have tons of USB cables and tried in on 2 workstations 3 PC's and 2 Laptops. Also tried reinstalling drivers and different operating systems. All to no avail.

My wife's Epic works fine using the same machines and cables. She however never got DK28 on her phone and got EB13 as her first mod and is now on EC05.

CWM3 not being able to find a file when trying to mount SD certainly has nothing to do with any USB cable. I just don't know if this is the root cause for USB not working or whether its a regular CWM problem.
[Epic 4G Android Development] richse:
What exactly happens when enter download mode and connect the phone to the computer?
[Epic 4G Android Development] LiberatorUSA:
Absolutely nothing data wise in any scenario.

It charges my battery, thats it.
[Epic 4G Android Development] richse:
So you don't even get an error on the computer about an unrecognized device?
[Epic 4G Android Development] LiberatorUSA:
Nope, it is the same as if it where not connected.

Thus I'm thinking there is simply no data being communicated whatsoever due to the software which controls the USB being broken.
[Epic 4G Android Development] richse:
I was under the impression that download mode has it's own usb driver. If that is the case then it doesn't make sense that both would be broken. I know you ruled it out but I just want to tell you that it could still be the cable. I had tried two different usb cables (the stock epic one and my friends micro cable that came with a different phone) and they both failed me for a week. I was at my wits end when k0nane mentioned in irc that I should really just buy a heavy duty one from amazon and it would work. I couldn't understand why two cables that worked with other phones wouldn't with mine but he was 100% right. My new cable works every time with no problem and those other cables still don't work. It's a pretty cheap solution to try if you are out of ideas.
[Epic 4G Android Development] yellaboyla:
Have you tried powering off ya phone, then holding down the 1 key, and powering back on??

then launch odin. flack back to orinal epic modem and pit.

i had the same issue as u. started from scratch and went back up to EC05

something gets housed in the software and u have to overwrite it to fix it

http://xdaforums.com/showthread.php?t=773032
[Epic 4G Android Development] LiberatorUSA:
Odin does not detect the phone. I have tried many times.

I don't think Odin has some magic which Windows doesn't have. If the OS doesn't even detect that a USB connection is made then I really doubt any app can either since they are using the O/S to access USB.

Like I said before I think the USB handshake is simply not occurring. If the device never sends any data it acts the same as any other device that only charges on USB and nothing else. In order for windows to say unrecognized device etc some communication must occur exchanging device type ID's etc which is then matched to a device driver.

Whatever happened killed the USB's data exchange ability.

Does anyone know where the USB logic is housed? It is part of the modem or kernel?

Some other people having the same problem:

http://xdaforums.com/showthread.php?t=942315
[Epic 4G Android Development] LiberatorUSA:
But if it was the cables I'm using you would expect:

1) It to work with or not work with both phones I used not just the DK28 one

2) The cables working or not not to change after flashing since they worked before flashing DK28

I have expensive fat/stiff cables from Motorola and other phones and some generic more flimsy ones. It makes no difference between all of these. They work for my wife's Epic (EB13/EC05) and not for mine (DK28).
[Epic 4G Android Development] nubecoder:
+1 to this.

With the current available tools, there is no way to upgrade a full modem with a flashable zip in recovery.

No if's, ands, or buts, just simple fact.

@ the OP, did you even test these files? (No offense meant to you.)

As in, Odin flash a modem (lets say DG27), and then test your files?

We currently only have delta patches (modem_delta.bin) for DI18 -> EC05 and EB13 -> EC05.

Those are the only modems that will successfully update through recovery.

Trust me I've tested multiple times, multiple ways (it seems DRockstar has as well).

Status 7 does not mean incompatible.

I'm not exactly sure what it means, but it does occur when an assert fails.

The reason your are getting error 7 when flashing from CM is that the build model's aren't SPH-D700 for CM I think it's just Epic4G or something.

(It's in the /system/build/prop file if you'd like to find out for yourself.)

So the assert for the phone's model is failing.

The reason you got an error before being on CM is because the delta patch doesn't match the modem you are applying it to (DK28 in this instance I believe).

Therefore the assert fails.

Hope this clears things up a bit...

Unless you can write a new flash tool for our phone, or it gets added to CWM (something I hope is a possibility), you won't get this to work.

The other option of course is attempting to create our own delta patch file.

I had plans to try to create a delta patch at one point, but other things have been occupying my time.

=]
[Epic 4G Android Development] DRockstar:
Just so you guys know, a new ReRFS ROM EC05 has been posted, and should be much more reliable than the previous dk28 one. It also has a link to a sumsung recovery flash, in case the phone is to be turned in...

Unfortunately, it can't do anything to flash the modem.

Figured I'd let you know, since the ReRFS dk28 was mentioned in this thread.
[Epic 4G Android Development] LiberatorUSA:
Thanks for chiming in. This is what I was suspecting.

So if I am to assume that USB functionality is part of the modem file and CWM must be loading the modem from that for it's mount USB functionality (which is not working for me either).

So In theory if CWM supported loading a different selectable modem (to be copied from SD) then that would at least allow people with a broken modem to mount the SD card. Small comfort of course since that won't update the modem but at least I could toy with it without needing to remove my SD card all the time etc. Just an idea.

Perhaps the main system OS could load a different modem into memory itself as a workaround? I don't know what is responsible for loading what and in what order.

I'm a software engineer myself but I don't know enough about how this all works to define a strategy or design tooling. You where talking about a modem delta tool. Can you give me some more details? If its something I can make with generic programming knowledge then I can give it a shot.
[Epic 4G Android Development] chris41g:
yes i did test it out on my own phone, multiple times, before uploading and after, but all i have is the dk28 modem... the script redbends an eb13 modem then write_firmware_image the eb13 to ec05 delta bin.. it changed the baseband in my about phone multiple times.. therefore i assumed it was sucessful. i borrowed the methodology from a zip i got on here that was update to di18 from any modem that was the same exact thing..
[Epic 4G Android Development] richse:
No, that's exactly what I thought but my friends cable works for his phone and not for my Epic since DK28. Also, my cable worked just fine for my phone prior to DK28. Now it does not work at all. Only the new cable I bought has been able to fix my problem.
[Epic 4G Android Development] LiberatorUSA:
That makes no sense but hey its worth a shot I guess.

Can you provide a link to the EXACT same cable that you think works with DK28?
[Epic 4G Android Development] Dameon87:
Once again, as previously stated. It is not possible. We have been working on the concept for ages, and without having the tools samsung uses for the delta OTAs, there is absolutely no way this will happen. The modem deltas are patched against certain versions of the radio only.
[Epic 4G Android Development] richse:
This is the exact one that I bought and was the only think that worked to get me off DK28. I really hope it works for you. http://www.amazon.com/AmazonBasics-...5ZSW/ref=sr_1_2?ie=UTF8&qid=1302313247&sr=8-2

Also, at the same time I got this K0nane also had me completely format my sdcard because he said it causes problems occasionally. You may want to give that a shot in conjunction with this,
[Epic 4G Android Development] nubecoder:
To my knowledge what you have described should not work.

And I know the file you are referring to (frion's anything to DI18 modem patch) and it doesn't work like it should either.

Not sure why it may have worked for you on DK28.

And don't take what I said as negative, sorry if it may have come across that way.

It's good you are trying, maybe you will find a solution where I have not.

ps- CWM built in flashing would be the best way to go IMO, we'll see if I ever get around to playing with the CWM sources.

=]
[Epic 4G Android Development] LiberatorUSA:
Can you help me understand the problem so I can spend some brain-cycles on it as well?

- What is a modem delta? Is it a subset of the modem? Is it a hash table for hash checks??

- What code checks this delta? Can we crack that code (assuming we only have the binaries) to always succeed? (as you would do with a PC game crack for example jne->je instruction switch)

If what your saying is correct then me and others who have the same problem are forever stuck on DK28.
[Epic 4G Android Development] Koadic:
As far as "what is a modem delta?", I can try to answer it like this...

Delta, Δ, the fourth letter in the greek alphabet... in the field of mathmatics, it basically means the difference between two variables, or the amount of change.

So, the modem_delta.bin is the difference between one modem version and another. For our purposes, just think of modem_delta.bin as a patch that has been created by Samsung.
[Epic 4G Android Development] LiberatorUSA:
I know what a delta is. But it can be expressed in many ways. The delta on the actual modem data or some hash mechanism which indicates what changed where.

From what your saying you seem to be hinting at the former. Which is good. We have the full DK28 modem I believe and the full EC05 modem for example.

We also have known patches DI18->EB13 I believe. If you have source file A and dest file B and a file showing the difference between the two then I imagine its possible to reverse engineer their diff file format. Hopefully its just based on binary blocks with a block index/header. if this is the case then it should be possible to make a tool to generate a delta file between any arbitrary file A and B provided you have the full files for both.

Do you have a set like that for me so I can take a look? A full modem A and a full modem B for which we have a modem delta file?

--Edit

Looking at the .tar version of a modem file for Odin I notice it does not include a delta file. So something which differs between the Odin method and the CWM method requires the delta file. What is that? Why does Odin not need a delta file?
[Epic 4G Android Development] Koadic:
I really don't know. Making no assumptions about anyone, I just tried to give a basic definintion. Upon reading your previous post again, and judging by the followup questions, I should have just left well enough alone. :D

I am sure they can be found just about everywhere on the forum (somewhere), but if you still need access to any of these files, here are some download links...

EB13 Modem

EC05 Modem

EB13 to EC05 Modem_Delta

As far as I know, Odin simply overwrites the specific partion(s) included in the .tar when it flashes, so it needs a full .bin/.rfs, which is why it can be used on a fairly nonfunctioning phone, so long as it can get into download mode it doesnt care what may be corrupt/missing. On the other hand, the stock recovery/CWM is used on a functioning phone, and everything should be working, so instead a 'patch' CAN be used (not that it has to). It just seems we don't have the tools available to fully reflash the modem.bin through recovery, so we're stuck with the patches.

Disclaimer (:D): I have practically no experience with programing, linux, or android (other that what I have done personally to my phone), and all comments made be me are merely based on my general (mis)understanding of things. While I may be fairly intelligent, and have a fairly high IQ (I'd like to think that anyway), I just don't have the background.

Edit: On another note, if you (or anyone for that matter) can somehow reverse engineer a tool to create a valid modem_delta.bin for any two given modem.bins, I am sure they would be just about everyone's favorite person around here.
[Epic 4G Android Development] LiberatorUSA:
Adding flashing of the full partition to CWM seems like the simpler solution so I have no idea why it does not support that. You can just wipe the whole partition and overwrite it using standard linux code or am I missing something?

There must be some reason they dont support it??

Thanks for the links. The reason i asked for them is because I dont want images people have messed around with. Just the original ones. With random downloads I have no idea what happened to those images so I dont want to make a tooling algorithm based on that.
[Epic 4G Android Development] chris41g:
the reason odin works, is because your phone is in download mode... and as far as i can tell redbend_ua will write to the partition, /dev/block/bml12 but the changes dont stick on reboot. cwm and i assume the stock recovery has a write_firmware_image, thats used to apply the modem_delta.bin. and that does stick after a reboot.

the basis was, and after testing on my phone only, with only a dk28 modem.. that i would write the eb13 modem.bin to bml12 with redbend_ua, then apply the eb13 to ec05 modem delta with write_firmware_image..

but since this is confirmed as not working i should kill the link and note it in the title...
[Epic 4G Android Development] LiberatorUSA:
Since making the delta function would be more involved then writing a full partition it makes no sense they would write code for that soley. Thus they probably use "write_firmware_image" from some Samsung binary instead of their own code. Can anyone confirm this?
[Epic 4G Android Development] chris41g:
well it has to be linked in the stock recovery or ota updates and update.zips wouldnt work
[Epic 4G Android Development] LiberatorUSA:
Right,.. I'm sure Samsung has their own version. I was wondering if they reverse engineered their own for CWM. I'm guessing not at this point. That does mean they must still be including the binary that has that function within CWM somehow.

It explains how they do the delta,.. but is there some extra difficulty in doing a full flash the way Odin does it?

I just imagine it as writing a script which wipes the modem partition and then flashes the full modem.bin into that partition from the start address of the partition,... Is it more difficult then that? Its nice to support the delta files the way they do but an option to flash a full modem would seem like an obvious thing to add so I'm left wondering why they didn't. There must be more to it then no?
[Epic 4G Android Development] chris41g:
to write the full partition the way odin or heimdall does the phone has to be in download mode.. well to make it stick after a reboot anyway.. there is another tool called bmlwrite i havent messed with only heard about
[Epic 4G Android Development] nubecoder:
In the hopes that you don't waste more of your time trying bmlwrite (I can confirm DRockstar's findings).

When I get some free time (lol ya right), I'll look into seeing if the delta is a simple diff + header or not...

Anyone wanna beat me to it? I've had the Idea since EC05 came out, just no time to research.

ps - write_firmware_image is a recovery command that loads the file into memory and applies it "after the updater exits".

=]
[Epic 4G Android Development] LiberatorUSA:
Ill see if I can write a tool to analyze the files tonight,.. to reverse engineer the file structure
[Epic 4G Android Development] Dameon87:
We have looked into it before. It uses a tool to package the delta. I can't remember exactly, but it is a proprietary tool, and there is not much info on it at all. I believe Samsung uses it internally to package OTA deltas.

All of the things in this thread have been tried before, and we were unable to get anything working.

This is not a discouragement post, but what you are trying is pretty much impossible without the tool samsung uses to package the deltas. The ONLY way you could get it working would be to generate a delta against the modem version you want to update from (With the same tool Samsung uses) and apply it against that modem type. Either way, there would have to be multiple deltas. CWM, and stock recovery are NOT able to write the modem firmware image properly. It is a feature of download mode. Hence why they are packaged as deltas, and not as full modems.
[Epic 4G Android Development] nubecoder:
Thank you very much for the more detailed explanation.

As I understand it, other manufacturers don't use delta patches in their OTAs.

(I could easily be wrong, please someone correct me.)

Could this be related to Samsung choosing BML over MTD?

(I'm still not really sure where BML came from, of course I assume it's proprietary.)

Just throwing out ideas at this point.

I do believe reverse engineering the delta creation process is possible, just maybe none of us have the experience, skills, or time.

I mean, we have an official build of Froyo, anything is possible right?!

=]
[Epic 4G Android Development] LiberatorUSA:
I got this cable today and as expected it makes no difference at all. USB still doesnt work. So other people reading this, save yourself a few dollars :)
[Epic 4G Android Development] richse:
It worked for me and a lot of other people. I'm really sorry it didn't work for you, but other people could still benefit from the new cable so don't tell everyone to ignore it.
[Epic 4G Android Development] LiberatorUSA:
Initial look at files

After an initial look at the files I noticed the following:

- There are massive blocks with value FF (255) in the modem files

- There are decent sized blocks with value 00 in the modem files

- There are a fair number of blocks identical between EB13 and EC05 and interestingly after some changes at offset x you will find identical blocks again at x+y. Thus changes do not perse shift everything indeed suggesting a fixed block size or at least fixed regions.

- blocks differing between the EB13 and EC05 modem do not appear in the delta file in identical form

- The delta file does not contain repeating values except for a small sequence of 0. They cannot use lossy compression so it seems likely something like Run Length Encoding is used.

Questions:

- Does the delta file employ a pallet to match value series like an image (picture) format?

- Is the system indeed block based as I suspect or is it like a pack where individual files are interpreter which I doubt?

- Wrt the delta file are we really dealing with packing or is this just a diff file where the instructions and data are interleaved at such a small block size that we overlook their matching? I can reduce the block matching size in my software but it will increase the number of false positives.
[Epic 4G Android Development] LiberatorUSA:
Does any of you have a DI07 full modem.bin? I have most other full modems and delta's. The more I have the easier it is to find patterns in the file format.

@Dameon87: You mention Samsung uses a proprietary tool. Did you base this on something specific? Yes the data is compressed but it can be any of the standard compression algorithms and not a Samsung invented algorithm. Did you confirm that this is not the case to save me some time?
[Epic 4G Android Development] nubecoder:
It seems I had the DI07 tar lying around, here's a link to the modem.bin.

Sorry I can't help more, but it seems you have more of a handle on this than I would if I was doing it.

Good luck!

=]
[Epic 4G Android Development] LiberatorUSA:
InnoPath's Delta Manager & redbend

Some interesting links I found:

InnoPath's Delta Manager:

http://www.innopath.com/solutions/mobile_update.shtml

http://www.wirelessinformaticsforum.org/_downloads/whitepapers/innopath_fota.pdf

Samsung is listed as InnoPath's customer for this system. This does not mean this is per se the system used for the Epic4G. But it is certainly worth investigating I'd say.

Sound like redbend?

http://www.redbend.com/index.php?option=com_content&view=article&id=111&Itemid=43&lang=en

http://www.redwhale.com/portfolio/InnoPath/UI/index4.html

Also:

http://www.icmu.org/icmu2010/Papers/3-1.pdf

This paper refers to redbend software & innopath in its references section and explains a file format for deltas. We know rebend_ua is usable to some extent on these devices so these guys are involved.
[Epic 4G Android Development] nubecoder:
I know I remember seeing "FOTA" inside either a moden.bin or a modem_delta.bin when viewing in a hex editor. And we definately have a fota.rc in our initramfs, but there isn't much in it and the "recovery_fota_mode" portion is commented out.

Also I've seen "Jupiter" referenced in the kernel, but I'm not sure it is anything to do with innoPath's software. Don't know why that would be in the linux kernel...

In the "Understanding FOTA" pdf, there is mention of a key used in the delta making process, that would put a major hindrance on us being able to create a valid delta.

Anyways, thanks for the links.

=]
[Epic 4G Android Development] dharkness:
so this is no worky =(
[Epic 4G Android Development] LiberatorUSA:
FOTA just stands for Firmware Over The Air. It is a generic term so I would not attach to much meaning to the use of the term in the context of reverse engineering.
[Epic 4G Android Development] pjames:
so any word on getting this fixed or has everybody given up?
[Epic 4G Android Development] chris41g:
Well I don't know about anyone else, but its low priority to me.. but I did accidentally stumble on some info that might be relevant.. ill take alook in the next few days
[Epic 4G Android Development] LiberatorUSA:
Qualcomm QSC6085

I have been busy myself as I might be moving to another state soon.

I think I know the process used to generate the modem.bin and the delta file based on the legal ramblings I posted before. What I need is to figure out the file format of the non-delta 15MB modem.bin. If I can extract the files as separate files I could write tooling to try and emulate a delta compression file.

I have not yet determined conclusively whether the full modem.bin is a Redbend update package or whether its a full partition dump and that partition includes the Redbend_ua (or similar) executable. The full modem bin also includes mention of Redbend and contains what appears to be an ELF format based executable.

From what I found it seems the Epic 4G uses the Qualcomm QSC6085 chipset which is what the data in that modem.bin is driving. An interesting article on the chipset can be found here:

https://www.droid-developers.org/images/2/25/Qsc6085-audio.pdf

It states that the chipset can boot from either the internal ROM or from external flash (see page 12 of that PDF) provided that the efuse is not blown. Since we are flashing into a flash partition with a modem.bin I think its safe to say that external flash is used. Based on this I would say that the memory map from this document should be mappable to boot code in the modem partition (which either is or gets constructed from the modem.bin).
[Epic 4G Android Development] LiberatorUSA:
Teardown

You can find more general teardown info here:

http://www.chipworks.com/en/technic.../teardown-of-the-samsung-epic-4g-smart-phone/

Info on ARM ELF's:

http://infocenter.arm.com/help/topic/com.arm.doc.dui0101a/DUI0101A_Elf.pdf

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0101a/index.html

For those who don't know: ELF is what you could call the ".exe" for Linux etc. Just like an .exe file has a file format allowing it to execute so does an elf file.
[Epic 4G Android Development] pjames:
keep up the work but i was able to get access to a laptop and update my phone