N900 Hardware USB Host

(Ideas for hostmode user-software)
Line 34: Line 34:
When an external power supply is found, the following should be done in sequence.
When an external power supply is found, the following should be done in sequence.
-
"Paul has found out that it is impossible (at least at the time of writing) to detect speed changes while VBUS is running, so for now, you have to select speeds manually.
+
*If the supply is a charger (D+,D- short, detected by the 1707a), fast charge.
-
Use common sense in doing so, '''high speed''' is for devices that require a lot of writing and are fairly new (flash drives/HDDs/CD-drives, new hubs).
+
*Attempt to enumerate as a device, if this succeeds (including handling of suspended busses), then enumerate and charge as a device, respecting the enumerated current.
-
'''Full speed''' devices are devices that do not require a lot of USB activity, such as BT/2.4GHz mouse transceivers.
+
*If enumeration as a device, and charger detection have failed, we may be plugged into a hub or device with reverse power. Attempt to enumerate connected devices. Charge at user-defined maximum current. For example - may be a 500mA power supply also supplying the hub and a keyboard = 2 unit loads - max draw = 300mA.
-
'''Low speed''' devices are normal mice and keyboards."
+
-
 
+
-
"A help window is available and will guide you through the steps needed.
+
-
The mount button is currently hardcoded to mount /dev/sda1, default for most USB flash drives and HDDs.
+
-
For NTFS support, do modprobe ntfs as root
+
-
For ISO (CDs/DVDs - most of them), do modprobe isofs (also as root).
+
-
CDs will have the dev node /dev/sr0, so you'll need to do mount /dev/sr0 /mnt etc...
+
-
Disabling tracker by adding /media/flash to tracker-cfg's non watch configuration is recomended, use tracker-cfg UI."
+
==Installation==
==Installation==

Revision as of 23:30, 12 November 2010

This page is for those working on the implementation of friendly USB host mode.

See also the garage project.

Contents

Status

USB Host mode has reached beta status, and is working reliably with manual speed switching.

Proper host mode would only require the normal cable, and a commonly available adapter. (USB A-A adaptor)

A pre-alpha of hostmode was released on the 23rd of September, here: http://talk.maemo.org/showthread.php?p=824298

This release is unreliable, and an implementation of proper host mode is likely to be much more stable.

A beta release, based on Paul's completely rewritten patches (see h-e-n's garage repository) was released on the 7th of November, and is the closest release yet to proper hostmode, http://talk.maemo.org/showthread.php?t=65232

There are several parts to getting USB host mode working for normal users.

Some of these are quite easy, many are not.

  • Kernel modifications to make USB host work properly [done, thanks to Paul]
  • USB modules for supporting hardware. This is fairly simple for most hardware - some hardware modules will not compile cleanly on ARM, and binary drivers that allow you to use windows drivers with some stuff will never work.

For most drivers, if a particular driver does not work, it's generally a bug in the driver that should be fixed by that drivers maintainer.

This is in progress. All of the hardware required to make a BME clone is understood.

  • Usermode software.
    • The current software will not do the right thing if the user plugs in almost all devices - even if hostmode worked. To make a mouse work, you might want to enable a pointer for example.

Ideas for hostmode user-software

When an external power supply is found, the following should be done in sequence.

  • If the supply is a charger (D+,D- short, detected by the 1707a), fast charge.
  • Attempt to enumerate as a device, if this succeeds (including handling of suspended busses), then enumerate and charge as a device, respecting the enumerated current.
  • If enumeration as a device, and charger detection have failed, we may be plugged into a hub or device with reverse power. Attempt to enumerate connected devices. Charge at user-defined maximum current. For example - may be a 500mA power supply also supplying the hub and a keyboard = 2 unit loads - max draw = 300mA.

Installation

Install hostmode-gui from -devel, your kernel will be replaced.

apt-get install hostmode-gui


Warning:

Uninstalling "h-e-n" might brick your device. However, it's easy to restore it to a working state by re-flashing the kernel.

Steps:

The .bin file has to be in the "current" directory.

  • Initiate flashing by pressing enter
  • Turn on your device, slide-down keyboard and press "U"
  • Wait until flashing is finished
  • You should get a working phone with all of your programs and settings.

Devices

You can plug-in almost anything into a usb port of the n900. However, many devices require a special driver in order to work. The custom kernel already provides basic drivers for devices such as:

  • USB Storage(cd-roms, flash drives, hdd, etc)
  • USB HID(Keyboards, mice, joysticks, touchpads, etc)

Demos

Hostmode development team:

Project Admins:

  • Joerg Reisenweber
  • Paul Fertser

Developers:

  • Chitrang Srivastava
  • Dave na
  • Hagen Meyer
  • Ian Stirling
  • Jacek Milewicz
  • Klaus Kurzmann
  • Mohammad Abu-Garbeyyeh
  • Mugur Enache
  • Sarah Newman
  • Sonny Jim
  • Tom Tanner

Most information is taken from this thread created by MohammadAG