N900 Hardware USB Host

(Demos)
 
(21 intermediate revisions not shown)
Line 1: Line 1:
 +
This page is for those working on the implementation of friendly USB host mode.
 +
 +
See also [https://garage.maemo.org/projects/h-e-n/ the garage project].
 +
==Status==
==Status==
-
'''Beta Release.'''
+
USB Host mode has reached beta status, and is working reliably with manual speed switching.
-
"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.
+
Proper host mode would only require the normal cable, and a commonly available adapter. ([http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=250641334947 USB A-A adaptor]) Or maybe you like to get a fitting all-in-one small adapter, or make one fit ([http://talk.maemo.org/showthread.php?p=873725#post873725 N8 OTG adapter rework]). Huge rigid adapters are STRONGLY DEPRECATED, regarding the notorious problems with USB receptacle coming off the PCB.
-
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).
+
 
-
'''Full speed''' devices are devices that do not require a lot of USB activity, such as BT/2.4GHz mouse transceivers.
+
A pre-alpha of hostmode was released on the 23rd of September, here: http://talk.maemo.org/showthread.php?p=824298
-
'''Low speed''' devices are normal mice and keyboards."
+
 
 +
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.
 +
 
 +
* Understanding and reverse engineering [[N900_Software_BME|BMEs (Battery managment Entity)]] interaction with the hardware.   
 +
 
 +
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 both 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 (=hostmode. Will not work due to [probably hardware] limitations in hostmode, which block speed selection after VBUS got applied). 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. Anyway see http://talk.maemo.org/showthread.php?p=921203#post921203 for actually powering N900 from external supply during hostmode. Implementation of this feature to h-e-n GUI still pending.
==Installation==
==Installation==
-
Install hostmode-gui from -devel, your kernel will be replaced.
+
Install hostmode-gui from -devel, kernel-power will be installed if no other compatible kernel is present.
-
apt-get install hostmode-gui
+
'''apt-get install hostmode-gui'''
 +
 
 +
[Update]
 +
 
 +
"The most recent h-e-n pkg itself should come '''without any kernel''' now (just the GUI), however, it does depend on kernel-feature-usbhost, so any kernel providing that works, if no kernel is installed, kernel-power will be installed, and - as mentioned in a previous post - h-e-n doesn't plan to ship any dedicated hostmode kernels anymore.
 +
The GUI will check if a compatible API is present (as per /proc/driver/musb_hdrc), and will notify to user if problems are detected (with hostmode support in whatever is the currently installed kernel).
 +
 
 +
Of course a mere update of h-e-n pkg won't magically switch from h-e-n hostmode kernel to power kernel. You have to care for that yourself."
 +
 
 +
==Usage==
 +
 
 +
A help window is available and will guide you through the steps needed.
 +
The mount button currently executes a script that reads /proc/partitions and mounts all devices there on /media/<partition_number>.
 +
The script will also modprobe ntfs and isofs (if /dev/sr0 is present), it will also create a temporary symlink (/dev/dvd) so mplayer works without any modifications (a package with DVD support compiled is needed)
 +
Disabling tracker by adding /media/<partition_name> to tracker-cfg's non watch configuration is HIGHLY recommended, use tracker-cfg UI.
== Devices ==
== Devices ==
-
* USB HDD
+
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 CD-ROM
+
 
-
* HUBS
+
* USB Storage(cd-roms, flash drives, hdd, etc)
-
* HID(Keyboards, mice, joysticks, touchpads, etc)
+
* USB HID(Keyboards, mice, joysticks, touchpads, etc)
== Demos ==
== Demos ==
-
http://www.youtube.com/watch?v=zDzUG-bno6Q by MohammadAG (usb CD-ROM)
+
* http://www.youtube.com/watch?v=zDzUG-bno6Q by MohammadAG (usb CD-ROM)
-
http://www.youtube.com/watch?v=1Qfx_jaQ9jo&NR=1 by divan0  (usb HDD via usbhub)
+
* http://www.youtube.com/watch?v=6ED92orZLMM by divan0 (usb flash drive)
-
http://www.youtube.com/watch?v=9byE_qTl15M by divan0 (usb keyboard)
+
* http://www.youtube.com/watch?v=1Qfx_jaQ9jo by divan0  (usb HDD via usbhub)
 +
* http://www.youtube.com/watch?v=ua5xpTZJpwo by divan0 (usb mouse)
 +
* http://www.youtube.com/watch?v=9byE_qTl15M by divan0 (usb keyboard)
 +
* http://www.youtube.com/watch?v=0YPk4Y0ZPQY by divan0 (usb card reader)
 +
* http://www.youtube.com/watch?v=3IyeSNGCWTA by divan0 (usb Ethernet adapter)
 +
* http://www.youtube.com/watch?v=AUjbFi3-GpA by davidxfoo (USB I2C Sonar SRF08)
==Hostmode development team:==
==Hostmode development team:==
Line 42: Line 92:
*Tom Tanner  
*Tom Tanner  
-
"Thanks to everyone part of the h-e-n team, and most importantly, thanks to Joerg Reisenweber for starting the project and leading it, and thanks to Paul Fertser for the new kernel patches, written from scratch."
+
Most information is taken from [http://talk.maemo.org/showthread.php?t=65232 this thread] created by MohammadAG
[[category:N900_Hardware]]
[[category:N900_Hardware]]

Latest revision as of 23:41, 8 January 2012

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

See also the garage project.

Contents

[edit] 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) Or maybe you like to get a fitting all-in-one small adapter, or make one fit (N8 OTG adapter rework). Huge rigid adapters are STRONGLY DEPRECATED, regarding the notorious problems with USB receptacle coming off the PCB.

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.

[edit] 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 both 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 (=hostmode. Will not work due to [probably hardware] limitations in hostmode, which block speed selection after VBUS got applied). 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. Anyway see http://talk.maemo.org/showthread.php?p=921203#post921203 for actually powering N900 from external supply during hostmode. Implementation of this feature to h-e-n GUI still pending.

[edit] Installation

Install hostmode-gui from -devel, kernel-power will be installed if no other compatible kernel is present.

apt-get install hostmode-gui

[Update]

"The most recent h-e-n pkg itself should come without any kernel now (just the GUI), however, it does depend on kernel-feature-usbhost, so any kernel providing that works, if no kernel is installed, kernel-power will be installed, and - as mentioned in a previous post - h-e-n doesn't plan to ship any dedicated hostmode kernels anymore. The GUI will check if a compatible API is present (as per /proc/driver/musb_hdrc), and will notify to user if problems are detected (with hostmode support in whatever is the currently installed kernel).

Of course a mere update of h-e-n pkg won't magically switch from h-e-n hostmode kernel to power kernel. You have to care for that yourself."

[edit] Usage

A help window is available and will guide you through the steps needed. The mount button currently executes a script that reads /proc/partitions and mounts all devices there on /media/<partition_number>. The script will also modprobe ntfs and isofs (if /dev/sr0 is present), it will also create a temporary symlink (/dev/dvd) so mplayer works without any modifications (a package with DVD support compiled is needed) Disabling tracker by adding /media/<partition_name> to tracker-cfg's non watch configuration is HIGHLY recommended, use tracker-cfg UI.

[edit] 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)

[edit] Demos

[edit] 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