ilyakurdyukov / spreadtrum_flash

Spreadtrum firmware dumper for Linux
93 stars 27 forks source link

usb_send failed : LIBUSB_ERROR_TIMEOUT #11

Open Z9044234820 opened 3 months ago

ilyakurdyukov commented 3 months ago

Describe what you are doing and under what circumstances the problem occurred, or I will close this issue.

Z9044234820 commented 3 months ago

When I use SPD_dump to dump the user partition to test the program, it uploads the FDL file successfully, but afterwards it shows this LIBUSB error (My device is SC9830)


$ sudo spd_dump         --verbose 2 --wait 1000000 fdl ./fdl1.bin 0x50000000 fdl ./fdl2.bin 0x9F000000 disable_transcode read_part user_partition 0 1M user_part.bin
[truncated]
send (536):
7e 00 02 02 10 00 00 00 00 00 00 00 00 00 00 00  |~...............|
00 00 00 00 00 03 00 00 00 04 00 00 00 02 00 00  |................|
00 01 00 00 00 0b 00 00 00 12 01 01 01 00 00 00  |................|
40 82 17 00 4d 02 02 00 00 00 01 00 00 09 02 20  |@...M...........|
00 01 01 00 c0 32 09 04 00 00 02 ff 00 00 00 07  |.....2..........|
05 85 02 40 00 00 07 05 06 02 40 00 00 53 70 72  |...@......@..Spr|
65 61 64 74 72 75 6d 20 42 6f 6f 74 20 42 6c 6f  |eadtrum.Boot.Blo|
63 6b 20 76 65 72 73 69 6f 6e 20 31 2e 31 00 46  |ck.version.1.1.F|
44 4c 5f 50 61 63 6b 65 74 44 6f 49 64 6c 65 00  |DL_PacketDoIdle.|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 c0 5f  |..............._|
81 00 00 01 03 02 06 03 09 04 0d 05 10 06 13 07  |................|
16 08 19 09 1c 0a 1f 0b 22 0c 26 0d 29 0e 2c 0f  |........".&.).,.|
2f 10 32 11 35 12 38 13 3b 14 3f 15 42 16 45 17  |/.2.5.8.;.?.B.E.|
48 18 4b 19 4e 1a 51 1b 54 1c 58 1d 5b 1e 5e 1f  |H.K.N.Q.T.X.[.^.|
61 aa aa 55 55 01 00 00 00 80 5d 77 50 00 a0 25  |a..UU.....]wP..%|
26 00 84 d7 17 00 c2 eb 0b 03 00 00 00 01 00 00  |&...............|
00 03 00 00 00 03 00 00 00 e8 03 00 00 84 03 00  |................|
00 00 00 00 00 34 08 00 00 f1 ff ff 3f 00 00 00  |.....4......?...|
00 00 00 00 00 00 00 00 00 55 55 aa aa 55 14 00  |.........UU..U..|
00 e1 15 00 00 02 19 00 00 23 1c 00 00 44 1f 00  |.........#...D..|
00 60 22 00 00 86 25 00 00 a7 28 00 00 0d 0a 64  |.`"...%...(....d|
64 72 20 74 72 61 69 6e 69 6e 67 20 6e 6f 74 20  |dr.training.not.|
64 6f 6e 65 21 00 0d 0a 64 64 72 20 74 72 61 69  |done!...ddr.trai|
6e 69 6e 67 20 65 72 72 6f 72 21 00 0d 0a 64 64  |ning.error!...dd|
72 20 61 75 74 6f 20 64 65 74 65 63 74 20 63 73  |r.auto.detect.cs|
30 20 66 61 69 6c 21 20 72 65 74 72 79 20 64 65  |0.fail!.retry.de|
74 65 63 74 00 0d 0a 64 64 72 20 61 75 74 6f 20  |tect...ddr.auto.|
64 65 74 65 63 74 20 63 73 30 20 66 61 69 6c 21  |detect.cs0.fail!|
00 0d 0a 64 64 72 20 61 75 74 6f 20 64 65 74 65  |...ddr.auto.dete|
63 74 20 63 73 30 20 6f 6b 21 00 0d 0a 64 64 72  |ct.cs0.ok!...ddr|
20 61 75 74 6f 20 64 65 74 65 63 74 20 63 73 31  |.auto.detect.cs1|
20 66 61 69 6c 21 00 0d 0a 20 63 61 6e 20 6e 6f  |.fail!....can.no|
74 20 66 69 6e 64 20 73 75 70 70 6f 72 74 65 64  |t.find.supported|
20 64 72 61 6d fe ae 7e                          |.dram..~|
recv (8):
7e 00 80 00 00 3b 5a 7e                          |~....;Z~|
send (536):
7e 00 02 02 10 20 69 6e 66 6f 21 00 54 68 65 20  |~.....info!.The.|
66 69 72 73 74 20 46 44 4c 20 66 61 69 6c 65 64  |first.FDL.failed|
21 0d 0a 00 64 61 74 61 5f 73 69 7a 65 20 65 72  |!...data_size.er|
72 6f 72 20 3a 20 64 61 74 61 73 69 7a 65 20 3d  |ror.:.datasize.=|
20 25 64 20 20 4d 41 58 5f 50 4b 54 5f 53 49 5a  |.%d..MAX_PKT_SIZ|
45 20 3d 20 25 64 0a 00 0a 0a 0a 25 73 20 25 73  |E.=.%d.....%s.%s|
20 25 64 0a 0a 0a 00 2f 68 6f 6d 65 2f 63 6d 65  |.%d..../home/cme|
2f 4c 44 30 31 33 30 2f 77 31 35 2e 34 33 2f 32  |/LD0130/w15.43/2|
30 31 36 30 37 32 38 2d 72 65 6c 65 61 73 65 2f  |0160728-release/|
73 70 72 64 5f 61 6e 64 72 6f 69 64 2f 63 68 69  |sprd_android/chi|
70 72 61 6d 2f 6e 61 6e 64 5f 66 64 6c 2f 63 6f  |pram/nand_fdl/co|
6d 6d 6f 6e 2f 70 61 63 6b 65 74 2e 63 00 25 34  |mmon/packet.c.%4|
78 25 34 78 00 25 32 78 00 0a 0a 0a 0a 00 ff ff  |x%4x.%2x........|
ff ff ff ff ff c0 00 00 00 09 0d 0a 0e 0f 04 03  |................|
00 0c 0a 06 03 00 a0 a0 00 06 03 04 05 03 03 02  |................|
02 05 00 02 02 02 02 00 00 02 02 03 03 1b 00 17  |................|
00 2b 00 17 00 01 00 26 00 00 00 00 00 05 06 00  |.+.....&........|
00 04 00 83 00 00 00 02 00 02 00 06 00 00 00 04  |................|
06 83 00 00 00 04 00 00 00 14 07 02 07 12 00 46  |...............F|
e0 bb db a0 00 c8 00 00 00 09 0d 0a 0e 0f 04 03  |................|
00 0c 0a 06 03 00 a0 a0 00 06 03 04 06 03 03 02  |................|
02 05 00 02 02 02 02 00 00 02 02 03 03 1c 00 18  |................|
00 2c 00 18 00 01 00 28 00 00 00 00 00 05 07 00  |.,.....(........|
00 04 00 83 00 00 00 02 00 02 00 07 00 00 00 04  |................|
06 83 00 00 00 04 00 00 00 14 07 02 07 12 00 48  |...............H|
e0 e2 e4 a0 00 80 01 00 00 11 1a 14 0f 1d 04 03  |................|
00 0c 0b 06 03 00 a0 a0 00 0c 05 04 0a 06 06 02  |................|
02 05 00 02 02 02 02 00 00 03 03 04 04 34 00 2e  |.............4..|
00 53 00 2e 00 01 00 4b 00 00 00 00 00 05 0c 00  |.S.....K........|
00 04 00 83 00 00 00 02 00 04 00 0c 00 00 00 04  |................|
06 83 00 00 00 04 00 00 00 14 08 02 08 23 00 8b  |.............#..|
e0 75 b7 41 01 90 01 00 00 12 1b 14 0f 1e 04 03  |.u.A............|
00 0c 0b 06 03 00 a0 a0 00 0c 05 04 0b 06 06 02  |................|
02 05 00 02 02 b3 ca 7e                          |.......~|
recv (8):
7e 00 80 00 00 3b 5a 7e                          |~....;Z~|
send (538):
7e 00 02 02 10 02 02 00 00 03 03 04 04 36 00 30  |~............6.0|
00 56 00 30 00 01 00 4f 00 00 00 00 00 05 0d 00  |.V.0...O........|
00 04 00 83 00 00 00 02 00 04 00 0d 00 00 00 04  |................|
06 83 00 00 00 04 00 00 00 14 08 02 08 24 00 90  |.............$..|
e0 c4 c9 41 01 f4 01 00 00 16 22 19 12 25 04 04  |...A......"..%..|
00 0d 0c 08 04 00 a0 a0 00 0f 06 04 0d 08 08 02  |................|
02 06 00 02 02 02 02 00 00 04 04 05 05 43 00 3c  |.............C.<|
00 6b 00 3c 00 01 00 62 00 00 00 00 00 05 10 00  |.k.<...b........|
00 06 00 c3 00 00 00 02 00 05 00 10 00 02 00 06  |................|
06 c3 00 00 00 06 00 00 00 1c 08 03 08 2d 00 b4  |.............-..|
e0 35 3c 92 01 15 02 00 00 18 24 1b 14 27 04 04  |.5<.......$..'..|
00 0d 0c 08 04 00 a0 a0 00 10 07 04 0e 08 08 02  |................|
02 06 00 02 02 02 02 00 00 04 04 05 05 48 00 40  |.............H.@|
00 72 00 40 00 01 00 69 00 00 00 00 00 05 11 00  |.r.@...i........|
00 06 00 c3 00 00 00 02 00 06 00 11 00 02 00 06  |................|
06 c3 00 00 00 06 00 00 00 1c 08 03 08 30 00 c0  |.............0..|
e0 f9 61 b2 01 58 02 00 00 1b 29 1e 14 2c 05 05  |..a..X....)..,..|
00 0f 0d 09 05 00 a0 a0 00 12 08 04 10 09 09 02  |................|
02 07 00 02 02 02 02 00 00 04 04 06 06 4e 00 49  |.............N.I|
00 7d 5e 00 49 00 01 00 76 00 00 00 00 00 05 13  |.}^.I...v.......|
00 00 07 00 e3 00 00 00 02 00 06 00 13 00 02 00  |................|
06 06 e3 00 00 00 07 00 00 00 1c 09 03 09 36 00  |..............6.|
d8 e0 a6 ae e2 01 80 02 00 00 1d 2b 20 16 2f 05  |...........+../.|
05 00 10 0d 0a 06 00 a0 a0 00 13 08 04 11 0a 0a  |................|
02 02 07 00 02 02 02 02 00 00 04 04 06 06 56 00  |..............V.|
4d 00 89 00 4d 00 01 00 7d 5d 00 00 00 00 00 05  |M...M...}]......|
14 00 00 18 00 03 00 00 00 02 00 07 00 14 00 04  |................|
00 08 06 03 00 00 00 18 00 00 00 20 09 04 09 3a  |...............:|
00 e7 e0 6d dc 02 02 9b 02 00 00 1e 2d 22 17 31  |...m........-".1|
06 06 00 11 0d 0a 06 00 a0 a0 00 14 09 04 12 0b  |................|
0b 02 02 08 00 02 02 02 02 00 00 04 04 06 06 57  |...............W|
00 51 00 8d 00 51 00 01 00 83 00 00 00 00 00 05  |.Q...Q..........|
15 00 00 18 00 23 00 00 00 02 00 07 00 15 00 04  |.....#..........|
00 08 06 23 00 00 00 54 a8 7e                    |...#...T.~|
recv (8):
7e 00 80 00 00 3b 5a 7e                          |~....;Z~|
send (536):
7e 00 02 02 10 18 00 00 00 20 09 04 09 3d 00 f1  |~............=..|
e0 53 fb 22 02 c0 00 00 00 80 01 00 00 f4 01 00  |.S."............|
00 80 02 00 00 06 03 00 00 01 00 00 00 08 00 00  |................|
00 20 00 00 00 0e 00 00 00 00 00 00 00 08 00 00  |................|
00 06 00 00 00 03 00 00 00 00 00 00 00 ac 51 00  |..............Q.|
50 a8 45 00 50 0e 03 00 00 01 00 00 00 08 00 00  |P.E.P...........|
00 20 00 00 00 0f 00 00 00 00 00 00 00 08 00 00  |................|
00 06 00 00 00 03 00 00 00 00 00 00 00 ac 51 00  |..............Q.|
50 a8 45 00 50 07 03 00 00 01 00 00 00 08 00 00  |P.E.P...........|
00 20 00 00 00 0f 00 00 00 00 00 00 00 08 00 00  |................|
00 06 00 00 00 03 00 00 00 00 00 00 00 ac 51 00  |..............Q.|
50 a8 45 00 50 8c 03 00 00 02 00 00 00 08 00 00  |P.E.P...........|
00 20 00 00 00 0e 00 00 00 00 00 00 00 08 00 00  |................|
00 06 00 00 00 03 00 00 00 00 00 00 00 ac 51 00  |..............Q.|
50 a8 45 00 50 8d 03 00 00 02 00 00 00 08 00 00  |P.E.P...........|
00 20 00 00 00 0f 00 00 00 00 00 00 00 08 00 00  |................|
00 06 00 00 00 03 00 00 00 00 00 00 00 ac 51 00  |..............Q.|
50 a8 45 00 50 9c 03 00 00 02 00 00 00 08 00 00  |P.E.P...........|
00 20 00 00 00 0f 00 00 00 00 00 00 00 08 00 00  |................|
00 06 00 00 00 03 00 00 00 00 00 00 00 ac 51 00  |..............Q.|
50 a8 45 00 50 8e 03 00 00 02 00 00 00 08 00 00  |P.E.P...........|
00 20 00 00 00 0f 00 00 00 00 00 00 00 08 00 00  |................|
00 06 00 00 00 03 00 00 00 00 00 00 00 ac 51 00  |..............Q.|
50 a8 45 00 50 ac 03 00 00 02 00 00 00 08 00 00  |P.E.P...........|
00 20 00 00 00 0e 00 00 00 00 00 00 00 08 00 00  |................|
00 06 00 00 00 03 00 00 00 00 00 00 00 ac 51 00  |..............Q.|
50 a8 45 00 50 26 03 00 00 01 00 00 00 08 00 00  |P.E.P&..........|
00 20 00 00 00 0e 00 00 00 00 00 00 00 08 00 00  |................|
00 06 00 00 00 03 00 00 00 00 00 00 00 ac 51 00  |..............Q.|
50 a8 45 00 50 01 00 00 00 00 00 00 00 01 00 00  |P.E.P...........|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00  |................|
00 01 00 00 00 00 00 00 00 00 00 00 00 00 01 00  |................|
00 01 00 00 00 01 00 00 00 01 00 00 00 00 00 00  |................|
00 01 00 00 00 42 41 7e                          |.....BA~|
recv (8):
7e 00 80 00 00 3b 5a 7e                          |~....;Z~|
send (536):
7e 00 02 02 10 00 00 00 00 20 00 00 00 01 00 00  |~...............|
00 00 00 00 00 01 00 00 00 20 00 00 00 01 00 00  |................|
00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00  |................|
00 00 00 00 00 00 01 00 00 01 00 00 00 00 00 00  |................|
00 00 00 00 00 00 01 00 00 01 00 00 00 01 00 00  |................|
00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00  |................|
00 08 00 00 00 01 00 00 00 00 00 00 00 01 00 00  |................|
00 08 00 00 00 01 00 00 00 00 00 00 00 01 00 00  |................|
00 00 00 00 00 01 00 00 00 00 00 00 00 40 00 00  |.............@..|
00 01 00 00 00 00 00 00 00 01 00 00 00 40 00 00  |.............@..|
00 01 00 00 00 01 00 00 00 01 00 00 00 00 00 00  |................|
00 01 00 00 00 00 00 00 00 10 00 00 00 01 00 00  |................|
00 00 00 00 00 01 00 00 00 10 00 00 00 01 00 00  |................|
00 01 00 00 00 01 00 00 00 00 00 00 00 01 00 00  |................|
00 00 00 00 00 02 00 00 00 01 00 00 00 00 00 00  |................|
00 01 00 00 00 02 00 00 00 01 00 00 00 01 00 00  |................|
00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00  |................|
00 02 00 00 00 01 00 00 00 00 00 00 00 01 00 00  |................|
00 02 00 00 00 00 00 00 00 01 00 00 00 01 00 00  |................|
00 00 00 00 00 01 00 00 00 00 00 00 00 02 00 00  |................|
00 01 00 00 00 00 00 00 00 01 00 00 00 02 00 00  |................|
00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00  |................|
00 01 00 00 00 00 00 00 00 10 00 00 00 01 00 00  |................|
00 00 00 00 00 01 00 00 00 10 00 00 00 ff 00 00  |................|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |................|
00 00 00 00 00 00 00 00 00 00 73 00 50 00 73 00  |..........s.P.s.|
50 b4 35 00 50 fc 35 00 50 f8 35 00 50 f4 35 00  |P.5.P.5.P.5.P.5.|
50 a4 36 00 50 cc 35 00 50 bc 35 00 50 c4 35 00  |P.6.P.5.P.5.P.5.|
50 00 00 00 00 ed fa 76 6f 6c 70 61 72 61 5f 62  |P......volpara_b|
65 67 69 6e 00 84 03 76 64 64 61 72 6d 00 00 00  |egin...vddarm...|
00 00 00 00 00 84 03 76 64 64 63 6f 72 65 00 00  |.......vddcore..|
00 00 00 00 00 00 00 76 64 64 6d 65 6d 00 00 00  |.......vddmem...|
00 00 00 00 00 55 e8 7e                          |.....U.~|
recv (8):
7e 00 80 00 00 3b 5a 7e                          |~....;Z~|
send (256):
7e 00 02 00 f8 00 00 76 64 64 67 65 6e 00 00 00  |~......vddgen...|
00 00 00 00 00 f0 0a 76 64 64 63 61 6d 6d 6f 74  |.......vddcammot|
00 00 00 00 00 af de 76 6f 6c 70 61 72 61 5f 65  |.......volpara_e|
6e 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00  |nd..............|
00 00 00 00 00 ee 0c 68 10 10 0b 10 0e 24 41 00  |.......h.....$A.|
50 e0 3f 00 50 1c 40 00 50 40 40 00 50 60 40 00  |P.?.P.@.P@@.P`@.|
50 b0 40 00 50 e4 40 00 50 1c 41 00 50 58 51 00  |P.@.P.@.P.A.PXQ.|
50 24 41 00 50 e0 3f 00 50 1c 40 00 50 40 40 00  |P$A.P.?.P.@.P@@.|
50 60 40 00 50 b0 40 00 50 e4 40 00 50 1c 41 00  |P`@.P.@.P.@.P.A.|
50 48 51 00 50 24 41 00 50 e0 3f 00 50 1c 40 00  |PHQ.P$A.P.?.P.@.|
50 40 40 00 50 60 40 00 50 b0 40 00 50 e4 40 00  |P@@.P`@.P.@.P.@.|
50 1c 41 00 50 50 51 00 50 24 41 00 50 e0 3f 00  |P.A.PPQ.P$A.P.?.|
50 1c 40 00 50 40 40 00 50 60 40 00 50 b0 40 00  |P.@.P@@.P`@.P.@.|
50 e4 40 00 50 1c 41 00 50 60 51 00 50 00 00 20  |P.@.P.A.P`Q.P...|
70 00 c2 01 00 00 00 30 70 00 c2 01 00 00 00 10  |p......0p.......|
70 00 c2 01 00 00 00 00 70 00 c2 01 00 4b 2d 7e  |p.......p....K-~|
recv (8):
7e 00 80 00 00 3b 5a 7e                          |~....;Z~|
send (8):
7e 00 03 00 00 59 50 7e                          |~....YP~|
recv (8):
7e 00 80 00 00 3b 5a 7e                          |~....;Z~|
send (8):
7e 00 04 00 00 dc c0 7e                          |~......~|
recv (8):
7e 00 80 00 00 3b 5a 7e                          |~....;Z~|
checkbaud 1
send (4):
7e 7e 7e 7e                                      |~~~~|
checkbaud 2
send (4):
7e 7e 7e 7e                                      |~~~~|
checkbaud 3
send (4):
7e 7e 7e 7e                                      |~~~~|
checkbaud 4
send (4):
7e 7e 7e 7e                                      |~~~~|
usb_send failed : LIBUSB_ERROR_TIMEOUT
Z9044234820 commented 3 months ago

Could it be an issue with my libusb version?


$ dpkg -l libusb-1.0*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version           Architecture Description
+++-======================-=================-============-===================================================
ii  libusb-1.0-0:amd64     2:1.0.25-1ubuntu2 amd64        userspace USB programming library
ii  libusb-1.0-0:i386      2:1.0.25-1ubuntu2 i386         userspace USB programming library
ii  libusb-1.0-0-dev:amd64 2:1.0.25-1ubuntu2 amd64        userspace USB programming library development files
ii  libusb-1.0-doc         2:1.0.25-1ubuntu2 all          documentation for userspace USB programming
ilyakurdyukov commented 3 months ago

FDL2 is not responding, possible reasons:

  1. Wrong FDL2, for a different chip revision. If you don't have the original firmware and are using FDLs from smartphones on the same chip, then some FDLs may not work.

  2. FDL2 is loaded to the wrong address.

There is nothing wrong with libusb as FDL1 works.

Z9044234820 commented 3 months ago

I do not have the original firmware, I am using FDL1 and FDL2 from different smartphone pac files with the same chip. I even tried without FDL2 but same error. Is FDL2 required for this to work?

ilyakurdyukov commented 3 months ago

I even tried without FDL2 but same error.

I mentioned FDL2, but it could also be FDL1. It seems to be FDL1 if it stops at spd_dump fdl ./fdl1.bin 0x50000000.

ilyakurdyukov commented 3 months ago

I found that there may be four revisions of this chip: SC9830 SC9830A SC9830I SC9830L

Z9044234820 commented 3 months ago

Could it also be due to wrong FDL 1 which results in the LIBUSB error timeout?

ilyakurdyukov commented 3 months ago

Yes, I said that in https://github.com/ilyakurdyukov/spreadtrum_flash/issues/11#issuecomment-2196951345

Try to load FDL1 first, nothing else, if you see this error, it means FDL1 is hung.