Support Tools

From OMAPpedia

(Difference between revisions)
Jump to: navigation, search
m (Android Gadget ADB: Windows PC Host)
m (Android Gadget ADB: Windows PC Host: -- formatting)
 
Line 188: Line 188:
  %CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D022&MI_01
  %CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D022&MI_01
  %CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D10A&MI_01
  %CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D10A&MI_01
-
 
+
  ; OMAP-3 / 4 - ICS
  ; OMAP-3 / 4 - ICS
  %CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D109&MI_01
  %CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D109&MI_01

Latest revision as of 15:39, 17 April 2012

Contents

[edit] Linux Host Setup

Details on how to setup the host machine with the necessary software tools and compilers can be seen at Host_PC_Setup

[edit] Installing USB to Serial on PC

Zoom2's debug should be connected and all switches on the debug should be set to "OFF" position.

  • Connect a USB cable mini-B connector to the J12 receptacle and the other side to the PC. Windows PC should recognize the USB to serial device connection as "USB Serial Converter A".

Note: If Windows does not recognize the USB to serial device as shown above go to http://www.ftdichip.com/Drivers/VCP.htm and download the latest FTDI drivers zip file. Extract the zip file and when installing the device drivers via the Windows “Found New Hardware” wizard, direct Windows to the FDTI directory that contains the *.inf files.

Usb-to-ser.jpg

  • Next install a Virtual COM port for this USB Serial Converter A. Right click on the above entry and in the advanced tab, select the Load VCP option as shown:
Driver.jpg

  • Once the above steps are taken select the Virtual COM port that will be used by Teraterm or Hyperterm.
Com-port.jpg

Connect Zoom2/Blaze to PC and open Teraterm or Hyperterm. Ensure that the following settings are selected:

For Blaze or Zoom2 (or for Panda Board or Beagle Board):

[edit] USB to "On The Go"

[edit] Hardware Setup

On "REV A" boards, USB works with power from any available source. Connect the USB cable to the main board: the ports on the debug board are not connected for USB.

For revisions prior to "REV A", including numbered revisions, power must be supplied either through the AC connector on the main board or from the battery connector, also on the main board. If you plug the AC adaptor to the debug board, USB will not work. Hardware configuration in which USB OTG port will work:

Note: AC power connected to main board, Battery connected to main board. NOTE: USB won't work if the power is connected to the debug board. Connect debug board before connecting power. (For the first lot of boards, Battery should be above 2V. This is fixed on final set of production boards. All boards before March,09 are first lot boards.)

Debug USB port remains at the same place J12 on debug board. MUSB OTG port is located on the Main board. Use the latest u-boot and x-loader as mentioned in the getting started on zoom2 guide.

Usbotg.jpg

Note: AC power connected to main board, Battery connected to main board. NOTE: USB won't work if the power is connected to the debug board. Connect debug board before connecting power. (For the first lot of boards, Battery should be above 2V. This is fixed on final set of production boards. All boards before March,09 are first lot boards.) Debug USB port remains at the same place J12 on debug board. MUSB OTG port is located on the Main board. Use the latest u-boot and x-loader as mentioned in the getting started on zoom2 guide.

[edit] ADB over USB

[edit] Android Gadget ADB: Linux PC Host

Sequence:

1. Boot the Android kernel with g_android built in and 'Android gadget adb' function selected

2. Connect one end of the cable to the MUSB port on the target and the other to the Linux HOST machine;

3. On the left hand top corner of the Android UI screen you should see a ‘USB Attached’ Notification.

4. Make sure on the target 'USB Debugging' is selected:

-On Android UI,
-Press F1 key,
-Goto Notifications
-Select USB debugging

5. To make ADB work for TI vendor ID, On your Host machine create the following file (if not already present):

$ sudo su
 <psswd>
$ mkdir ~/.android
$ vi ~/.android/adb_usb.ini
$ echo "0x0451" > ~/.android/adb_usb.ini
$ cat /root/.android/adb_usb.ini
  0x0451

6. Mount the 'usbfs' filesystem on the Linux Host Machine (Note: optional step, ignore if usbfs is not present in Ubuntu 10.10)

$ sudo mount -t usbfs none /proc/bus/usb

7. Also, on the Host make sure adb server is running:

$ sudo su
 <psswd>
$ cd <path>/mydroid/out/host/linux-x86/bin
$ ./adb kill-server
$ ./adb start-server

8. Verify that the gadget enumerated properly on the host (Linux PC) by running: (Note: optional step, ignore if usbfs is not present in Ubuntu 10.10)

$ cat  /proc/bus/usb/devices | grep “usbfs”

9. Now check that the device is connected:

$ cd <path>/mydroid/out/host/linux-x86/bin
$ ./adb devices

[output should be something like this] List of devices attached [serial number] device

$ ./adb shell

[This should take you to the console prompt of the board] to quit, type exit. 10. Write a file in to the FS on board:

$ ./adb push <path>/file ./

[This will transfer 'file' in to the / of the FS on the board, check using 'ls' on the console prompt of the board] 11. Read a file from the FS on board into the Host machine

$ ./adb pull ./file <path>/dir/

[This will copy 'file' from the FS into the Host machine]


NOTE: You can use locally built version that should just work on your boxes without the extra configurations.

 ADB Binary is here


NOTE: These instructions assume that you will always be running ADB operations in super user mode. To run ADB over USB as your normal user, create/edit adb_usb.ini in your home directory instead i.e step 5 would look this:

$ mkdir -p ~/.android
$ echo "0x0451" > ~/.android/adb_usb.ini
$ cat ~/.android/adb_usb.ini
  0x0451

However, you will have to start adb in sudo mode.

$ sudo <path>/mydroid/out/host/linux-x86/bin/adb kill-server
$ sudo <path>/mydroid/out/host/linux-x86/bin/adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
686A00011FF00000        device

[edit] Android Gadget ADB: Windows PC Host

Sequence:

1. On windows Host, Download latest Android SDK (http://developer.android.com/sdk/index.html), the installer version is recommended.

2. At the end of the installation select the option "Start SDK Manager".

3. If you are behind a firewall you'll need to go to Tools -> Options of the SDK Manager to enter your proxy info. Go to Packages -> Reload if you enter proxy info.

4. At a minimum install the following packages:

Note: If "Google USB Driver" doesn't show up initially then install the platform-tools, close SDK Manager, and open SDK-manager.

5. Optionally, you may want to add the location of the SDK's primary tools directory to your system PATH. Right-click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path (under System Variables). Add the full path to the tools\ directory to the path.

6. Create a file "%USERPROFILE%\.android\adb_usb.ini":

> echo 0x0451 > "%USERPROFILE%\.android\adb_usb.ini"
> type "%USERPROFILE%\.android\adb_usb.ini"
0x0451

7. Edit android_winusb.inf (found in C:\Program Files\Android\android-sdk\extras\google\usb_driver on a Windows XP installation) to match TI vendor ID and USB Gadgets product ID's:

; OMAP-3/4
%SingleAdbInterface% = USB_Install, USB\VID_0451&PID_D101
%CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D102&MI_01
%CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D106&MI_02
%CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D107&MI_03
%SingleAdbInterface% = USB_Install, USB\VID_0451&PID_FFFFE
%CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_FFFE&MI_01
%SingleAdbInterface% = USB_Install, USB\VID_0451&PID_D022
%CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D022&MI_01
%CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D10A&MI_01

; OMAP-3 / 4 - ICS
%CompositeAdbInterface% = USB_Install, USB\VID_0451&PID_D109&MI_01


8. Boot the Android kernel with g_android built in and 'Android gadget adb' function selected

9. Connect micro-B USB cable between Blaze board and Windows PC.

10. Windows should pop up a driver installation dialog

ADB XP Driver Dialog.png

11. Once the driver is installed, the device should appear in the Device Manager as shown:

Device manager.jpg

12. Open command prompt and restart adb server just to make sure it is in a proper state:

$ adb kill-server
$ adb start-server
$ adb devices

[output should be something like this]

ADB cmd screenshot.png

13. Write a file in to the FS on board:

$ adb push <path>/file ./

[This will transfer 'file' in to the / of the FS on the board, check using 'ls' on the console prompt of the board]

14. Read a file from the FS on board into the Host machine

$ adb pull ./file <path>/dir/

[This will copy 'file' from the FS into the Host machine]

[edit] Windows troubleshooting

1. On the left hand top corner of the Android UI screen you should see a ‘USB Attached’ Notification.

2. Make sure on the target 'USB Debugging' is selected:

3. Go to 'Device Manager' (Right click on 'My computer', select 'Manage', selcet 'Device Manager' under system tools in the left column) and see if your device is enumerated as: "Blaze" OR "OMAP-3/4" OR "OMAP3"/"OMAP4" [for older releases]

4. Install driver for the device using android_winusb.inf file

- Right click on the enumerated device
- select 'update driver' option
- Provide the path to the android_winusb.inf file

If it fails, click on your enumerated device in the 'Device Manager' with right mouse button then 'Properties' -> Details -> Hardware Ids, check the PID (e.g. "VID_0451&PID_DXXX") then update it in your android_winusb.inf file and retry the driver update.


[edit] finding the Vendor ID and Product ID of the device

You need to modify the .inf file that comes with the driver to match the Vendor ID and the Product ID of the board. To find the VID and PID of your board, connect the board to your windows computer. if this one proposes you to install a driver, say no and go to the device manager in the control panel.

right click ->properties and then click on the 'details' tab of the new USB peripheral.

select the 'Device Instance Id' to get the VID and the PID :

VID PID.jpg


then go back to the device manager, right click -> "uninstall" on the USB device, and disconnect the device.

[edit] ADB over Ethernet

Check if you have the following property set in your init.rc. If not do it manually on the console

# setprop service.adb.tcp.port 5555
# stop adbd
# start adbd

Set the environment variable ADBHOST to the IP address of your board:

$ export ADBHOST=<Board IP>

Also, on the Host make sure adb server is running:

$ sudo su
  <psswd> 
$ cd <path>/mydroid/out/host/linux-x86/bin
$ ./adb kill-server
$ ./adb start-server
$ ./adb devices

[output should be something like this]

List of devices attached

[Emulator-device-number] device

$ ./adb shell

[This should take you to the console prompt of the board] to quit, type exit.

[edit] Firewalls

"Git" is a great tool and does work behind proxy's / firewalls with a little help. There are many ways to do this however this section will only cover "corkscrew".


[edit] Corkscrew

Download "corkscrew" at Corkscrew and un-tar it.

cd corkscrew-2.0
./configure
make
cp corkscrew ~/bin/corkscrew

This can be placed anywhere as long as it is in PATH. Next create the following simple shell script called git-proxy in ~/bin directory (or some place listed in PATH).Replace items inbetween "<...> with the correct information.

#!/bin/sh
exec <path_to_corkscrew>/corkscrew <proxy_name> <proxy port> $*

Save the file and give it execute permissions

chmod u+x git-proxy

Run it to test it. It should give the usage statement for corkscrew.

Now tell git you want to use a proxy. Replace the stuff between the "<...>" and don't leave out the single quotes.

git config --global core.gitproxy '<path_to_proxy>/git-proxy'

This will setup "git" to always use the proxy for all git commands, with all git trees.

To set the proxy for just a specific git tree execute instead something similar to the following. The below command configures "git" to use the proxy for all URLs with a kernel.org suffix.

git config --global core.gitproxy '"<path to proxy>/git-proxy"; for kernel.org' 'for kernel.org$'

[edit] Ubuntu's Firewall setting

Configure Ubuntu's "Network Proxy" appropriately to get access to source code


Configure the Proxy for the package manager:


Configure "http_proxy" and "ftp_proxy" environmental variable:

If there is a need to use a proxy server to access the web set the environment variables "http_proxy" and "ftp_proxy". This will allow "apt-get" etc. to use this environment variable value. Below would be the ideal way of assigning values for "http_proxy":

# export http_proxy=”<proxy-server>:<port>”  
# export ftp_proxy="<proxy-server>:<port>"

eg:
# export http_proxy="http://<servername>:80"

Add this to ~/.bashrc so that everytime the machine is rebooted this variable does not have to be exported.

[edit] Serial Console over USB to OTG

Uboot, xloaded and an wokring kernel should be built prior to proceeding with this section. Refer to [[|]] for more information regarding uboot and xloader.

Refer to USB to "On The Go" for hardware setup.


[edit] Kernel Configuration

On Zoom-I and Zoom-II, to enable Serial console over USB OTG the following configurations to the kernel should be set.

CONFIG_USB_GADGET_MUSB_HDRC=y
CONFIG_USB_GADGET=y
CONFIG_USB_GADGET_DEBUG=y
CONFIG_USB_GADGET_DEBUG_FILES=y
CONFIG_USB_GADGET_SELECTED=y
CONFIG_USB_GADGET_DUALSPEED=y
CONFIG_USB_G_SERIAL=y


To enable above configuration follow the steps listed below

cd <path_to_kernel_directory>
# make CROSS_COMPILE=arm-none-linux-gnueabi- menuconfig

Selected the following menu options:


[edit] Initiating serial console

[edit] On Target

Run the following commands to establish serial console.

# cat /proc/devices

Character devices:
  1 mem
  2 pty
  3 ttyp
  4 /dev/vc/0
  4 tty
  4 ttyS
  5 /dev/tty
  5 /dev/console
  5 /dev/ptmx
  6 lp
  7 vcs
 10 misc
 13 input
 14 sound
 21 sg
 29 fb
 99 ppdev
116 alsa
128 ptm
136 pts
180 usb
189 usb_device
259 ttyGS


# mknod /dev/ttyGS0 c 259 0


# /sbin/getty -L /dev/ttyGS0 115200 vt100


[edit] Host side

minicom -s

serial console should read:

# login: root <enter>
# ls
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox