Skip to content
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

ver expected #2

Closed
medanisjbara opened this issue Mar 23, 2023 · 14 comments
Closed

ver expected #2

medanisjbara opened this issue Mar 23, 2023 · 14 comments

Comments

@medanisjbara
Copy link

I tried running this on Energizer Energy E12 (which has a Spreadtrum SC6531E according to the specifications). and I got ver expected as an output.
The output seems to be from this ERR_EXIT.
Does this mean that the chipset in the specification page is not the correct one ?
If I understand correctly, this error message is printed if the data received is not in the correct format ?

I should note that I didn't try any other firmware dumper other than this. I will comment here if I ever did.

@medanisjbara
Copy link
Author

While I am sure I'm not qualified to debug this. I tried doing the following.

diff --git a/spd_dump.c b/spd_dump.c
index 8f1a77e..4781e33 100644
--- a/spd_dump.c
+++ b/spd_dump.c
@@ -1068,8 +1068,11 @@ int main(int argc, char **argv) {
 				encode_msg(io, BSL_CMD_CHECK_BAUD, NULL, 1);
 				send_msg(io);
 				ret = recv_msg(io);
-				if (recv_type(io) != BSL_REP_VER)
+				int x = recv_type(io);
+				if (x != BSL_REP_VER) {
+					printf("recv_type(io): 0x%x\n",x);
 					ERR_EXIT("ver expected\n");
+				}
 
 				DBG_LOG("BSL_REP_VER: ");
 				print_string(stderr, io->raw_buf + 4, READ16_BE(io->raw_buf + 2));

And I tried the same ./spd_dump fdl nor_fdl1.bin 0x40004000 read_flash 0x80000003 0 0 x400000 flash.bin command to see what recv_type(io) is outputting. And the the output I got wasn't what I expected.

Waiting for connection (30s)
recv_type(io): 0xffffffff
ver expected

Even the number of bites is different, it seems. Maybe I'm doing something wrong ?

@medanisjbara
Copy link
Author

Note: I'm not pressing any boot key as I wasn't able to locate any key that makes a difference in the delay time before boot.

@ilyakurdyukov
Copy link
Owner

This is what happens if you turn on without holding the boot key or haven't found the right one.

@ilyakurdyukov
Copy link
Owner

recv_type(io): 0xffffffff

Means timeout, the device is not responding. Which is normal if you haven't enabled boot mode, because you aren't holding the right boot key.

I can find the boot key from the firmware for this phone model, but I didn't find this firmware on the internet.

@ilyakurdyukov
Copy link
Owner

Before looking for a boot key, check the chip model. Pull out the battery and connect to USB, if after a few seconds it shows that charging is in progress - this is SC6531E (look for a boot key without a battery), if not - it means SC6531DA (for which it is more difficult to look for a boot key, because you need to pull out the battery every time).

I found on the internet that some models require pressing two keys at the same time, but I did not come across such.

@ilyakurdyukov
Copy link
Owner

You can use an OTG adapter or a special boot cable to bypass the boot key.

@medanisjbara
Copy link
Author

Means timeout, the device is not responding.

Thank you for the explanation. Is there a chance you can add this to the README ?

I didn't find this firmware on the internet.

Unfortunately, the fact that it's not available is why I am trying to dump it. However, while looking, I was able to find this website which contains some USB drivers (and I'm assuming that they can be helpful in retrieving the firmware without having to know the boot key). I think I will look into that as a last resort.

@ilyakurdyukov
Copy link
Owner

which contains some USB drivers (and I'm assuming that they can be helpful in retrieving the firmware without having to know the boot key)

Drivers will not help you avoid the boot key, only a boot cable (or an OTG adapter) can help.

This site is telling you bullshit, because they have generic Spreadtrum drivers, not specific to this model. What you can see from the filenames.

@medanisjbara
Copy link
Author

medanisjbara commented Mar 24, 2023

if after a few seconds it shows that charging is in progress

This doesn't seem to be the case. The screen flashes for a split second and gets black again before flashing again and so on. I'm assuming this is how SC6531DA behaves.

for which it is more difficult to look for a boot key, because you need to pull out the battery every time

I did exactly that this time and was able to determine the boot key (which is the number "1").

BSL_REP_VER: "SPRD3\0"
BSL_REP_VER: "Custom FDL1: CHIP ID = 0x65620001\0"
dump_flash: 0x80000003+0x0, target: 0x400000, read: 0x400000

Awesome! Thank you.

@ilyakurdyukov
Copy link
Owner

These drivers are for use with Spreadtrum's flashing tools, which will also require you to know the boot key or use a boot cable.

@medanisjbara
Copy link
Author

You can use an OTG adapter or a special boot cable to bypass the boot key.

I would like to learn more about how this is done if possible.

@ilyakurdyukov
Copy link
Owner

This doesn't seem to be the case. The screen flashes for a split second and gets black again before flashing again and so on. I'm assuming this is how SC6531DA behaves.

I'm not sure about this, the SC6531DA just won't connect via USB when plugged in without a battery. I don't remember if the screen is flashing.

BSL_REP_VER: "SPRD3\0"
loadfile("nor_fdl1.bin") failed

You can find nor_fdl1.bin in Releases.

@ilyakurdyukov
Copy link
Owner

You can use an OTG adapter or a special boot cable to bypass the boot key.

I would like to learn more about how this is done if possible.

This is explained in the Readme:

Instead of finding the boot key (sometimes there's no boot key, as on smart watches with only the power key), it's more convenient to use a boot cable with shorted 4th and 5th pins. This is the same as for OTG adapters, so you can combine an OTG adapter with an AM to AM USB cable.

@medanisjbara
Copy link
Author

Okay, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants