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 over USB issue

Other Parts Discussed in Thread: AM3352

Hi!

I'm trying to get ADB working in Android on a custom platform based on AM3352. When connecting my host computer to the target platform there is no output on either end. Other devices connected to the platform are detected successfully (a touchscreen).

I have read that ADB requires Android Gadget so I enabled it in menuconfig for the kernel. However when the init script tries to run "echo 1 > /sys/class/android_usb/android0/enable" the system crashes (log below). The only information I can find regarding this is https://groups.google.com/forum/#!topic/android-kernel/YBgkQPsXxi4 . According to that post I guess it means the "platform code" for USB OTG is not installed in my system. USB OTG is enabled already in the kernel configuration. How can I fix this?

On another note I cannot seem to insmod the g_zero module, instead I get the following message: "insmod: init_module 'g_zero.ko' failed (No such device)". I am not sure if this is related. Is g_zero required for ADB to work?

[ 1401.244784] Unable to handle kernel NULL pointer dereference at virtual address 00000018
[ 1401.253276] pgd = cfa08000
[ 1401.256096] [00000018] *pgd=8fa11831, *pte=00000000, *ppte=00000000
[ 1401.262665] Internal error: Oops: 17 [#1] PREEMPT
[ 1401.267567] Modules linked in:
[ 1401.270758] CPU: 0    Not tainted  (3.1.0-g62911f8-dirty #93)
[ 1401.276770] PC is at enable_store+0xb8/0x17c
[ 1401.281228] LR is at walk_stackframe+0x24/0x40
[ 1401.285860] pc : [<c028c49c>]    lr : [<c001898c>]    psr: 60000013
[ 1401.285867] sp : cfa03ed8  ip : cfa03da8  fp : cfa03efc
[ 1401.297831] r10: cf3e7408  r9 : c0400db4  r8 : 00000002
[ 1401.303276] r7 : c059f928  r6 : 00000002  r5 : 00000000  r4 : cf3f8740
[ 1401.310079] r3 : 00000000  r2 : c003dd58  r1 : cfa03dd8  r0 : 0000001a
[ 1401.316886] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[ 1401.324328] Control: 10c5387d  Table: 8fa08019  DAC: 00000015
[ 1401.330315] 
[ 1401.330318] PC: 0xc028c41c:
[ 1401.334765] c41c  ebfcf5ca e51b1020 e3510000 0a000006 e5d43014 e3530000 159f10fc 0a000014
[ 1401.343331] c43c  e59f00f8 eb05237d ea00000e e5d43014 e3530000 059f10e8 0afffff8 e5950000
[ 1401.351894] c45c  e5903000 e5933014 e3530000 0a000000 e12fff33 e1a00005 e59f10c8 ebffffbb
[ 1401.360458] c47c  e3a03000 e5c43014 e1a00006 e24bd01c e89da8f0 e59f70b0 e59f00b0 eb052367
[ 1401.369021] c49c  e5953018 e1d720b8 e59f00a4 e7d73412 e5853018 e5d7300a e5c5301b e5d7300b
[ 1401.377585] c4bc  e5c5301c e1d720bc e595301c e7d73412 e585301c e5d73004 e5c53015 e5d73005
[ 1401.386149] c4dc  e5c53016 e5d73006 e5c53017 eb052353 e28710ec e59f205c e1a00005 ebfffdaf
[ 1401.394713] c4fc  e59f0054 eb05234d e5950000 e5903000 e5933014 e3530000 0a000001 e3a01001
[ 1401.403278] 
[ 1401.403281] LR: 0xc001890c:
[ 1401.407728] 890c  e5901004 e1a03000 e5902000 e281000c e1520000 2a000001 e3e00015 e89da800
[ 1401.416292] 892c  e2811d7f e2820004 e281103f e3c11d7f e3c1103f e1510000 9afffff6 e512100c
[ 1401.424855] 894c  e3a00000 e5831000 e5121008 e5831004 e5122004 e583200c e89da800 e1a0c00d
[ 1401.433419] 896c  e92dd8f0 e24cb004 e1a04000 e1a05001 e1a06002 e1a01006 e1a00004 e12fff35
[ 1401.441983] 898c  e3500000 e1a00004 189da8f0 ebffffd8 e3500000 aafffff6 e89da8f0 e1a0c00d
[ 1401.450546] 89ac  e92dd810 e24cb004 e24dd024 e1a0200d e1a04001 e3c23d7f e591200c e3c3303f
[ 1401.459110] 89cc  e593300c e50b1020 e1500003 e50b2018 0a000018 e5903004 e3a02001 e50b201c
[ 1401.467674] 89ec  e3a01000 e5932038 e50b2030 e593203c e50b1028 e50b202c e5933040 e50b3024
[ 1401.476238] 
[ 1401.476241] SP: 0xcfa03e58:
[ 1401.480689] 3e58  c01c8b40 c01c8a08 cfa03eac cfa03e70 c01c9480 c01c8b30 c028c49c 60000013
[ 1401.489252] 3e78  ffffffff cfa03ec4 cfa03efc cfa03e90 c0014c18 c000844c 0000001a cfa03dd8
[ 1401.497815] 3e98  c003dd58 00000000 cf3f8740 00000000 00000002 c059f928 00000002 c0400db4
[ 1401.506379] 3eb8  cf3e7408 cfa03efc cfa03da8 cfa03ed8 c001898c c028c49c 60000013 ffffffff
[ 1401.514943] 3ed8  0001e118 00000001 ca839318 cfa03f70 cf3e17e8 ca839300 cfa03f0c cfa03f00
[ 1401.523506] 3ef8  c0214d10 c028c3f0 cfa03f3c cfa03f10 c010f7a0 c0214cf8 cfa03f70 cf966c40
[ 1401.532069] 3f18  00000002 0001e118 cfa03f70 00000000 00000000 00000000 cfa03f6c cfa03f40
[ 1401.540633] 3f38  c00b2240 c010f6a8 cfa02000 cf966c48 cfa03f94 cf966c40 0001e118 00000002
[ 1401.549197] 
[ 1401.549200] IP: 0xcfa03d28:
[ 1401.553648] 3d28  cf8416b4 cf850380 cfa03d54 cfa03d40 c03d5264 c003db04 00000017 cfa03d5c
[ 1401.562211] 3d48  cfa03d84 cfa03d68 c001b5a4 c03d524c c04998dc cfa03e90 00000018 00000000
[ 1401.570774] 3d68  00000017 cf841680 cf8416b4 cf850380 cfa03dac cfa03d88 c001b668 c001908c
[ 1401.579337] 3d88  cf841680 cfa03e90 00000018 00010000 00000017 cf8416b4 cfa03de4 cfa03db0
[ 1401.587901] 3da8  c001b7e0 c001b608 c057bd88 00000001 cfa03dec 00000017 c0566ab0 00000018
[ 1401.596464] 3dc8  cfa03e90 00000002 c0400db4 cf3e7408 cfa03e8c cfa03de8 c000847c c001b694
[ 1401.605028] 3de8  c0035550 c0017518 cfa02000 00000000 cfa03eac cfa03e08 c003dd58 c00354b8
[ 1401.613591] 3e08  c05b4c08 00000003 0000001a cfa03e44 00000008 60000013 00000000 10624dd3
[ 1401.622156] 
[ 1401.622159] FP: 0xcfa03e7c:
[ 1401.626606] 3e7c  cfa03ec4 cfa03efc cfa03e90 c0014c18 c000844c 0000001a cfa03dd8 c003dd58
[ 1401.635169] 3e9c  00000000 cf3f8740 00000000 00000002 c059f928 00000002 c0400db4 cf3e7408
[ 1401.643733] 3ebc  cfa03efc cfa03da8 cfa03ed8 c001898c c028c49c 60000013 ffffffff 0001e118
[ 1401.652296] 3edc  00000001 ca839318 cfa03f70 cf3e17e8 ca839300 cfa03f0c cfa03f00 c0214d10
[ 1401.660860] 3efc  c028c3f0 cfa03f3c cfa03f10 c010f7a0 c0214cf8 cfa03f70 cf966c40 00000002
[ 1401.669422] 3f1c  0001e118 cfa03f70 00000000 00000000 00000000 cfa03f6c cfa03f40 c00b2240
[ 1401.677985] 3f3c  c010f6a8 cfa02000 cf966c48 cfa03f94 cf966c40 0001e118 00000002 00000004
[ 1401.686548] 3f5c  00000000 cfa03fa4 cfa03f70 c00b23b0 c00b2194 00000000 00000000 0001c6a8
[ 1401.695113] 
[ 1401.695116] R1: 0xcfa03d58:
[ 1401.699564] 3d58  c04998dc cfa03e90 00000018 00000000 00000017 cf841680 cf8416b4 cf850380
[ 1401.708127] 3d78  cfa03dac cfa03d88 c001b668 c001908c cf841680 cfa03e90 00000018 00010000
[ 1401.716691] 3d98  00000017 cf8416b4 cfa03de4 cfa03db0 c001b7e0 c001b608 c057bd88 00000001
[ 1401.725254] 3db8  cfa03dec 00000017 c0566ab0 00000018 cfa03e90 00000002 c0400db4 cf3e7408
[ 1401.733818] 3dd8  cfa03e8c cfa03de8 c000847c c001b694 c0035550 c0017518 cfa02000 00000000
[ 1401.742381] 3df8  cfa03eac cfa03e08 c003dd58 c00354b8 c05b4c08 00000003 0000001a cfa03e44
[ 1401.750945] 3e18  00000008 60000013 00000000 10624dd3 3b9aca00 c05b4b58 c05b4c08 00000146
[ 1401.759508] 3e38  0000000f 000000af cfa03ed0 3431205b 322e3130 32383234 00205d35 cfa03e60
[ 1401.768073] 
[ 1401.768077] R2: 0xc003dcd8:
[ 1401.772524] dcd8  0a00000a e51b0080 e59030a0 e3530000 1a000003 ea000082 e5933034 e3530000
[ 1401.781088] dcf8  0a00007f e1d322b8 e3120010 0afffff9 e3a05000 e3a07001 e3e03000 e5863050
[ 1401.789651] dd18  e3a00001 ebffdde2 e1a0100d e3c14d7f e3c4403f e5943000 e3130002 1a00007b
[ 1401.798215] dd38  e3550000 1a000063 e3570000 1a000064 e51b2090 e121f002 e3a00001 ebffddd4
[ 1401.806778] dd58  e5943000 e3130002 1a00007d e1a00008 e24bd028 e89daff0 e51b509c e3a0003c
[ 1401.815342] dd78  e2855003 e50b509c ebfffbfa e51b0034 e2800030 e6ef0070 ebfffbf6 e3a0003e
[ 1401.823906] dd98  ebfffbf4 e5963058 e3530000 0affffb8 e30b8d88 e30a4597 e34c8057 e3055f41
[ 1401.832469] ddb8  e34346b4 e3485970 e5980050 eb008a58 e51bc084 e0832094 e1720004 e0b33005
[ 1401.841033] 
[ 1401.841037] R4: 0xcf3f86c0:
[ 1401.845484] 86c0  cf3e2ac0 cf3d3604 cf9031f8 cf820980 cf9031f8 c0599f60 cf3e1788 00000002
[ 1401.854047] 86e0  00000003 c05a0470 00000000 00000000 00000000 00000000 00000000 00000000
[ 1401.862610] 8700  cf3e2d00 cf87a5b8 cf87a5b8 cf820980 cf87a5b8 c0599f60 cf3e1bd8 00000002
[ 1401.871173] 8720  00000003 cf3f8780 00000000 00000000 00000000 00000000 00000000 00000000
[ 1401.879736] 8740  c059fcc0 cf3f8744 cf3f8744 00000000 cf3e7400 00000000 00000200 cf3f875c
[ 1401.888299] 8760  cf3f875c c02903e4 00000000 00000000 00000000 00000000 00000000 00000000
[ 1401.896861] 8780  c04e0004 00000000 00000000 00000000 00000000 cf820d80 00000000 00000000
[ 1401.905424] 87a0  c0219d8c 00000000 00000000 00000000 00000000 00000000 00000000 cf87a540
[ 1401.913988] 
[ 1401.913991] R7: 0xc059f8a8:
[ 1401.918437] f8a8  c04de31c 00000080 00000000 c0288714 c04de32c 00000124 c028864c 00000000
[ 1401.927001] f8c8  c04de334 00000124 c028861c 00000000 c04de344 00000124 c02885ec 00000000
[ 1401.935564] f8e8  c04de34c 00000124 c02885bc 00000000 c04de35c 00000124 c028858c 00000000
[ 1401.944128] f908  c04de36c 00000124 c028855c 00000000 c04de37c 00000124 c028852c 00000000
[ 1401.952691] f928  02000112 00000000 000118d1 0000ffff 00000100 00000000 c04e0528 00000000
[ 1401.961254] f948  00000000 00000409 00ffff02 00000000 c05a00fc 00000000 c059f94c c059ff50
[ 1401.969816] f968  c059ff5c 00000000 c059f94c c059ff68 c059ff74 00000000 00000000 c04e0598
[ 1401.978380] f988  00000000 00000000 00000409 00ffff03 00000000 c05a010c 00000000 c05a0114
[ 1401.986944] 
[ 1401.986947] R9: 0xc0400d34:
[ 1401.991394] 0d34  00000000 69766564 635f6563 74616572 65725f65 7361656c 00000065 69766564
[ 1401.999959] 0d54  6d5f6563 0065766f 69766564 725f6563 6d616e65 00000065 c0214d50 c0214d98
[ 1402.008522] 0d74  c0215b64 5f766564 65766575 0000746e 69766564 755f6563 6765726e 65747369
[ 1402.017086] 0d94  00000072 69766564 615f6563 00006464 69766564 735f6563 64747568 006e776f
[ 1402.025650] 0db4  c0215884 c0214cec 64737973 645f7665 65766972 65725f72 74736967 00007265
[ 1402.034213] 0dd4  c0216d10 c0216d38 64737973 725f7665 73696765 00726574 64737973 635f7665
[ 1402.042777] 0df4  7373616c 726e755f 73696765 00726574 c0216d60 c0216d88 64737973 635f7665
[ 1402.051340] 0e14  7373616c 6765725f 65747369 00000072 c02174a0 00000000 00000000 76697264
[ 1402.059905] 
[ 1402.059908] R10: 0xcf3e7388:
[ 1402.064446] 7388  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1402.073008] 73a8  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1402.081571] 73c8  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 1402.090134] 73e8  00000000 00000000 00000000 00000000 00000000 00000000 00000000 cf3e0f40
[ 1402.098697] 7408  cf3e2dc0 cf3e7254 cf3e780c cf3f8700 cf820e40 c0599f40 cf3e1ba8 00000002
[ 1402.107260] 7428  00000007 00000000 00000000 00000001 cf3e7438 cf3e7438 00000000 00000000
[ 1402.115825] 7448  00000000 00000000 00000000 cf3e729c cf3e7854 7fffffff cf3e7460 cf3e7460
[ 1402.124388] 7468  00000000 00000000 00000000 00000000 c05c5280 c0220eec cf3e7400 ffffffff
[ 1402.132956] Process sh (pid: 742, stack limit = 0xcfa022f0)
[ 1402.138764] Stack: (0xcfa03ed8 to 0xcfa04000)
[ 1402.143306] 3ec0:                                                       0001e118 00000001
[ 1402.151836] 3ee0: ca839318 cfa03f70 cf3e17e8 ca839300 cfa03f0c cfa03f00 c0214d10 c028c3f0
[ 1402.160365] 3f00: cfa03f3c cfa03f10 c010f7a0 c0214cf8 cfa03f70 cf966c40 00000002 0001e118
[ 1402.168894] 3f20: cfa03f70 00000000 00000000 00000000 cfa03f6c cfa03f40 c00b2240 c010f6a8
[ 1402.177424] 3f40: cfa02000 cf966c48 cfa03f94 cf966c40 0001e118 00000002 00000004 00000000
[ 1402.185953] 3f60: cfa03fa4 cfa03f70 c00b23b0 c00b2194 00000000 00000000 0001c6a8 00000000
[ 1402.194483] 3f80: c00152a8 00000002 00000002 00000000 c00152a8 cfa02000 00000000 cfa03fa8
[ 1402.203011] 3fa0: c0015100 c00b2378 00000002 00000002 00000001 0001e118 00000002 0001cb40
[ 1402.211540] 3fc0: 00000002 00000002 00000000 00000004 00000001 00000001 0001c6d8 beca9dea
[ 1402.220069] 3fe0: 0001b808 beca9968 000163d5 afd0b47c 60000010 00000001 dddfffff dfff7f7d
[ 1402.228593] Backtrace: 
[ 1402.231162] [<c028c3e4>] (enable_store+0x0/0x17c) from [<c0214d10>] (dev_attr_store+0x24/0x28)
[ 1402.240140]  r7:ca839300 r6:cf3e17e8 r5:cfa03f70 r4:ca839318
[ 1402.246077] [<c0214cec>] (dev_attr_store+0x0/0x28) from [<c010f7a0>] (sysfs_write_file+0x104/0x184)
[ 1402.255520] [<c010f69c>] (sysfs_write_file+0x0/0x184) from [<c00b2240>] (vfs_write+0xb8/0x14c)
[ 1402.264504] [<c00b2188>] (vfs_write+0x0/0x14c) from [<c00b23b0>] (sys_write+0x44/0x74)
[ 1402.272756]  r8:00000000 r7:00000004 r6:00000002 r5:0001e118 r4:cf966c40
[ 1402.279784] [<c00b236c>] (sys_write+0x0/0x74) from [<c0015100>] (ret_fast_syscall+0x0/0x30)
[ 1402.288488]  r9:cfa02000 r8:c00152a8 r6:00000000 r5:00000002 r4:00000002
[ 1402.295503] Code: e89da8f0 e59f70b0 e59f00b0 eb052367 (e5953018) 
[ 1402.302039] ---[ end trace 3fd782377ba5596a ]---
[ 1402.306861] Kernel panic - not syncing: Fatal exception
[ 1402.312330] Backtrace: 
[ 1402.314911] [<c0018f74>] (dump_backtrace+0x0/0x10c) from [<c03d5098>] (dump_stack+0x18/0x1c)
[ 1402.323723]  r7:00000001 r6:c028c49e r5:c05b4710 r4:c05b4710
[ 1402.329655] [<c03d5080>] (dump_stack+0x0/0x1c) from [<c03d5108>] (panic+0x6c/0x1a0)
[ 1402.337658] [<c03d509c>] (panic+0x0/0x1a0) from [<c00192d8>] (die+0x258/0x2bc)
[ 1402.345202]  r3:00000001 r2:cfa02000 r1:cfa03c80 r0:c0499400
[ 1402.351144] [<c0019080>] (die+0x0/0x2bc) from [<c001b668>] (__do_kernel_fault+0x6c/0x8c)
[ 1402.359587] [<c001b5fc>] (__do_kernel_fault+0x0/0x8c) from [<c001b7e0>] (do_page_fault+0x158/0x1f4)
[ 1402.369032]  r9:cf8416b4 r8:00000017 r7:00010000 r6:00000018 r5:cfa03e90
[ 1402.375868] r4:cf841680
[ 1402.378611] [<c001b688>] (do_page_fault+0x0/0x1f4) from [<c000847c>] (do_DataAbort+0x3c/0xa4)
[ 1402.387523] [<c0008440>] (do_DataAbort+0x0/0xa4) from [<c0014c18>] (__dabt_svc+0x38/0x60)
[ 1402.396061] Exception stack(0xcfa03e90 to 0xcfa03ed8)
[ 1402.401345] 3e80:                                     0000001a cfa03dd8 c003dd58 00000000
[ 1402.409875] 3ea0: cf3f8740 00000000 00000002 c059f928 00000002 c0400db4 cf3e7408 cfa03efc
[ 1402.418418] 3ec0: cfa03da8 cfa03ed8 c001898c c028c49c 60000013 ffffffff
[ 1402.425323]  r7:cfa03ec4 r6:ffffffff r5:60000013 r4:c028c49c
[ 1402.431265] [<c028c3e4>] (enable_store+0x0/0x17c) from [<c0214d10>] (dev_attr_store+0x24/0x28)
[ 1402.440245]  r7:ca839300 r6:cf3e17e8 r5:cfa03f70 r4:ca839318
[ 1402.446187] [<c0214cec>] (dev_attr_store+0x0/0x28) from [<c010f7a0>] (sysfs_write_file+0x104/0x184)
[ 1402.455642] [<c010f69c>] (sysfs_write_file+0x0/0x184) from [<c00b2240>] (vfs_write+0xb8/0x14c)
[ 1402.464639] [<c00b2188>] (vfs_write+0x0/0x14c) from [<c00b23b0>] (sys_write+0x44/0x74)
[ 1402.472906]  r8:00000000 r7:00000004 r6:00000002 r5:0001e118 r4:cf966c40
[ 1402.479927] [<c00b236c>] (sys_write+0x0/0x74) from [<c0015100>] (ret_fast_syscall+0x0/0x30)
[ 1402.488648]  r9:cfa02000 r8:c00152a8 r6:00000000 r5:00000002 r4:00000002

Regards

Christoffer