This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

adb can not push with file greater than 405 bytes

I'm porting Android rowboat Gingerbread 2.3.4 to work on TAM-3517 Twister,

I can use adb shell connect to device and able to use adb pull to get file from device properly but

adb install and adb push is not working, adb push can not work on file size greater than 405 bytes,

I don't know how to debug adb please advice, thanks.

 

adb push failed, needed to unplug and replug usb adb back to operation (able to adb shell).

 

$ ADB_TRACE=1 adb push 406b.bin /data/local
_adb_connect: host:version
writex: fd=3 len=4: 30303063  000c
writex: fd=3 len=12: 686f73743a76657273696f6e  host:version
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
4f4b4159  OKAY
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
30303034  0004
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
30303161  001a
_adb_connect: sync:
writex: fd=3 len=4: 30303132  0012
writex: fd=3 len=18: 686f73743a7472616e73706f72742d61  host:transport-a
Switch transport in progress
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
4f4b4159  OKAY
Switch transport success
writex: fd=3 len=4: 30303035  0005
writex: fd=3 len=5: 73796e633a  sync:
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
4f4b4159  OKAY
writex: fd=3 len=8: 535441540b000000  STAT....
writex: fd=3 len=11: 2f646174612f6c6f63616c  /data/local
readx: fd=3 wanted=16
readx: fd=3 wanted=16 got=16
53544154f9410000a803000049d4554e  STAT.A......I.UN
writex: fd=3 len=8: 53454e441a000000  SEND....
writex: fd=3 len=20: 2f646174612f6c6f63616c2f34303662  /data/local/406b
writex: fd=3 len=6: 2c3333313838  ,33188
writex: fd=3 len=4068: 44415441dc0f00000000000000000000  DATA............
writex: fd=3 len=8: 444f4e45a7d1554e  DONE..UN
readx: fd=3 wanted=8

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
usb freeze after this line, unplug and replug usb adb back to operation (able to adb shell).


adb push working properly if file size is lower than 406 bytes.
$ ADB_TRACE=1 adb push 405b.bin /data/local
_adb_connect: host:version
writex: fd=3 len=4: 30303063  000c
writex: fd=3 len=12: 686f73743a76657273696f6e  host:version
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
4f4b4159  OKAY
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
30303034  0004
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
30303161  001a
_adb_connect: sync:
writex: fd=3 len=4: 30303132  0012
writex: fd=3 len=18: 686f73743a7472616e73706f72742d61  host:transport-a
Switch transport in progress
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
4f4b4159  OKAY
Switch transport success
writex: fd=3 len=4: 30303035  0005
writex: fd=3 len=5: 73796e633a  sync:
readx: fd=3 wanted=4
readx: fd=3 wanted=4 got=4
4f4b4159  OKAY
writex: fd=3 len=8: 535441540b000000  STAT....
writex: fd=3 len=11: 2f646174612f6c6f63616c  /data/local
readx: fd=3 wanted=16
readx: fd=3 wanted=16 got=16
53544154f9410000a8030000e1d4554e  STAT.A........UN
writex: fd=3 len=8: 53454e441a000000  SEND....
writex: fd=3 len=20: 2f646174612f6c6f63616c2f34303562  /data/local/405b
writex: fd=3 len=6: 2c3333313838  ,33188
writex: fd=3 len=4058: 44415441d20f00000000000000000000  DATA............
writex: fd=3 len=8: 444f4e4585d1554e  DONE..UN
readx: fd=3 wanted=8
readx: fd=3 wanted=8 got=8
4f4b415900000000  OKAY....
95 KB/s (4050 bytes in 0.041s)
writex: fd=3 len=8: 5155495400000000  QUIT....
  • Please provide the logcat output from your device to help us debug this.

  • No log generated on both push 405 and 406 bytes to device, only log below when plug usb. How do I setup to open more debug message ?

    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    D/Vold    (  875): USB disconnected
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    D/Vold    (  875): USB connected
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    D/Vold    (  875): USB disconnected
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    D/Vold    (  875): USB connected
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    D/Vold    (  875): USB disconnected
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    W/Vold    (  875): Ignoring unknown switch 'usb_connected'
    D/Vold    (  875): USB connected
    
  • You can change the logging level by modifying init.rc. You need to modify the below line and change 3 to 4 or above to get more logs:

    loglevel 3

    ...

    Also, just a thought... are you seeing this issue only on your board or on AM3517evm too. Can you build and run the kernel uImage for AM3517evm from the same sources and check?

  • changing loglevel to 8 not help, no log print out from adb push or any adb operation.

    This board is not AM3517evm but TAM-3517 Twister, I use source code from  rowboat Gingerbread 2.3.4 port to this board.

    using strace to adbd, this problem might from adbd itself

     

    output from strace -p <adb pid> shown below,

    using adb push 405b.bin /data/local (successful) vs. adb push 406b.bin /data/local (fail)

    below is interesting system call

       write(76, "/data/local/405b.bin,33188DATA�\17"..., 4092) = 4092

    vs. adb push 406b.bin

    write(76, "/data/local/406b.bin,33188DATA�\17"..., 4096) = 4096

    from adb source (rowboat-android/system/core/adb/*) I saw most buffer size is 4096 bytes may be something wrong around here, and found a few stuff in source code,

    changing loglevel might not help.

     

    Thank you for your kind help,


    $ adb push 405b.bin /data/local
    ) = 1 (in [28])
    read(28, "�\34\3\0", 4)                 = 4
    socketpair(PF_UNIX, SOCK_STREAM, 0, [76, 77]) = 0
    fcntl64(76, F_SETFD, FD_CLOEXEC)        = 0
    fcntl64(77, F_SETFD, FD_CLOEXEC)        = 0
    mmap2(0x10000000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_
    NORESERVE, -1, 0) = 0x40144000
    mprotect(0x40144000, 4096, PROT_NONE)   = 0
    clone(child_stack=0x40243f00, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND
    |CLONE_THREAD|CLONE_SYSVSEM|CLONE_DETACHED) = 2142
    fcntl64(76, F_SETFD, FD_CLOEXEC)        = 0
    fcntl64(76, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
    write(28, "p�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [28])
    read(28, "H�\2\0", 4)                   = 4
    write(76, "STAT\v\0\0\0", 8)            = 8
    write(28, "H�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [28])
    read(28, "p�\2\0", 4)                   = 4
    write(76, "/data/local", 11)            = 11
    write(28, "p�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [76])
    read(76, "STAT�A\0\0(\1\0\0k?WN", 4096) = 16
    read(76, 0x2fca4, 4080)                 = -1 EAGAIN (Try again)
    write(28, "p�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74], [], [], NULL) = 1 (in [28])
    read(28, "H�\2\0", 4)                   = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [28])
    read(28, "p�\2\0", 4)                   = 4
    write(76, "SEND\32\0\0\0", 8)           = 8
    write(28, "H�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [28])
    read(28, "\230\f\3\0", 4)               = 4
    write(76, "/data/local/405b.bin,33188DATA�\17"..., 4092) = 4092
    write(28, "p�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [76])
    read(76, "OKAY\0\0\0\0", 4096)          = 8
    read(76, 0x2fc9c, 4088)                 = -1 EAGAIN (Try again)
    write(28, "p�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74], [], [], NULL) = 1 (in [28])
    read(28, "H�\2\0", 4)                   = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [28])
    read(28, "p�\2\0", 4)                   = 4
    write(76, "QUIT\0\0\0\0", 8)            = 8
    write(28, "H�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 2 (in [28 76])
    read(28, "\230\f\3\0", 4)               = 4
    write(28, "H�\2\0", 4)                  = 4
    close(76)                               = 0
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74], [], [], NULL



    $ adb push 406b.bin /data/local
     
    ) = 1 (in [28])
    read(28, "�\34\3\0", 4)                 = 4
    socketpair(PF_UNIX, SOCK_STREAM, 0, [76, 77]) = 0
    fcntl64(76, F_SETFD, FD_CLOEXEC)        = 0
    fcntl64(77, F_SETFD, FD_CLOEXEC)        = 0
    mmap2(0x10000000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_
    NORESERVE, -1, 0) = 0x40144000
    mprotect(0x40144000, 4096, PROT_NONE)   = 0
    clone(child_stack=0x40243f00, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND
    |CLONE_THREAD|CLONE_SYSVSEM|CLONE_DETACHED) = 2220
    fcntl64(76, F_SETFD, FD_CLOEXEC)        = 0
    fcntl64(76, F_SETFL, O_RDONLY|O_NONBLOCK) = 0
    write(28, "p�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [28])
    read(28, "H�\2\0", 4)                   = 4
    write(76, "STAT\v\0\0\0", 8)            = 8
    write(28, "H�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [28])
    read(28, "p�\2\0", 4)                   = 4
    write(76, "/data/local", 11)            = 11
    write(28, "p�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [76])
    read(76, "STAT�A\0\0(\1\0\0y?WN", 4096) = 16
    read(76, 0x2fca4, 4080)                 = -1 EAGAIN (Try again)
    write(28, "p�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74], [], [], NULL) = 1 (in [28])
    read(28, "H�\2\0", 4)                   = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [28])
    read(28, "p�\2\0", 4)                   = 4
    write(76, "SEND\32\0\0\0", 8)           = 8
    write(28, "H�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL) = 1 (in [28])
    read(28, "\230\f\3\0", 4)               = 4
    write(76, "/data/local/406b.bin,33188DATA�\17"..., 4096) = 4096
    write(28, "p�\2\0", 4)                  = 4
    select(77, [4 5 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 4
    0 44 48 52 56 60 62 64 66 68 70 72 74 76], [], [], NULL
    
    
  • Thanks for the info.

    We will look into this and get back to you.

  • Hi,

     

    This problem solved already,

    I think some of kernel config is wrong, I've reviewed mine with am3517_evm_android_defconfig some of them difference such as disable DMA

    CONFIG_MUSB_PIO_ONLY=y

     

     

  • Hi all,

    sry for asking on answered post...

    Can you tell me how to get ADB-connection to TAM3517 on Twisterboard???

    Cause if I check for devices with command "adb devices" I always get an empty list....

  • A few things to check:

    - is adb platform support added to your board file?
    - is adb enabled in your kernel build?
    - do you see adb_init or similar logs in kernel boot log?
    - do you see any logs when you attach or detach the adb usb cable?

    Please start a new topic the next time and not hijack an existing thread.