---+!! Table Of Contents %TOC% ---++ Some thoughts I created this topic for discussion of the future USB-On-The-Go (USB OTG) support in RockBox. The discussion will be based on iriver H3x0 for the moment, because 1 i have iriver H340 2 the other device the RockBox port is working on with USB host caps is [[IaudioPort][IaudioX5]], but we don't have the specific chip's documentation atm. OK, [[IriverH3XXHardwareComponents][iriver]] H3x0 has [[http://www.rockbox.org/twiki/pub/Main/DataSheets/USBHost1.1-PhilipsISP1362-04.pdf Philips ISP1362 USB OTG controller]], which features 2 hardware ports - the first can be used as Device, as Host, and as OTG port, while the second can be used only as Host port. It seems like the iriver uses the first one, because on the US iriver it's used as device port. This chip fully supports USB 1.1 specifications + <nop>OnTheGo Supplement to USB 2.0 specs. Also, it supports all standard transfer modes (Control (ok, it's needed for USB to work AT ALL), Isochronous (used mostly for real-time transfers like audio & video), INT (used mostly for devices like HID - Humain Interface Device like keyboards, mice, joysticks, for other devices too (like some of USB Mass Storage protocols) and Bulk (used for USB Mass storage, printers, scanners). The only restriction i know till now is the current with which the chip can supply the usb ports - it's lower than the standard 500mA; We will need support for AT LEAST 2 device classes: 1 USB mass storage 2 Still Image (PTP - picture transfer protocol, many cameras use this for transfering the images to a computer) and maybe the protocol used in older Canon cameras (reverse engineered afaik) * Some Canon cameras (eg S45 ~late 2002) support both PTP or the default "normal" (canon protocol) as chosen in Menu -> Tools -> Communication. Source code for [[http://www.gphoto.org gphoto2]] may provide insight into PTP and canon protocol when needed. -- TroyMartinez - 07 Aug 2005 * There is also a small app used to capture images from a camera. It would be WAY cool if it was ported to Rockbox. [[http://capture.sf.net/ Sourceforge `capture` page]], [[http://www.ucl.cas.cz/~petr/plant-growth/ original author's website]]. Capture relies on libptp and uses some Canon (and Nikon?) extensions for capturing. -- AlexandreBourget - 29 Aug 2005 --- ---++ Dreams * To be able to "mount" the USB device in the way MMC is mounted in Archos Ondio ... (as soon as we have a working MSD class, this should be fairly simple -- Jens Arnold 21 Apr 2006) * To be able to use for example keyboard for text input (needs new USB device class support - HID) (alternative: Most HIDs support two classes, the full-fledged HID class and the much simpler bootkeyboard resp. bootmouse class. The boot* classes don't support fancy extras like multimedia keys or extra mouse buttons, but will be _much_ easier to implement. -- JensArnold - 21 Apr 2006) * Connecting an USB TV tuner(or DMB) to watch TV on the H300 * Connecting a WLAN adapter to listen to web radio or to use the player as SIP phone * To have a tiny interface to the [[http://capture.sourceforge.net/ capture]] utility, and capture still photos remotely using the H300. Also control flash type, aperture, shutter speed, and have everything dumped right onto the iRiver disk :) -- AlexandreBourget - 29 Aug 2005 * To support a more expansive list of MP3 players and UMS storage devices, maybe even ones with custom protocols. * Support multiple devices at the same time. The example is a multi-card-reader where you want more than access only the first card. -- PeterDHoye - 28 Nov 2005 (This will most probably require the hub class, and multi-function device support. Handling multiple cards with multivolume + hotplug should then be easy. -- JensArnold 21 Apr 2006) * USB Webcam support (to use it as a mass storage video camera, with e.g. [[http://www.rastageeks.org/ov51x-jpeg/index.php/Main_Page Trust Spacecam 320 driver]]) - RonaldTeune - 27 Dec 2005 --- ---++ Questions & Discussion 1 DO we really need *full* OTG support? I mean: Do we need the port to act like a OTG port in terms of being capable to switch between the Device & Host Mode on request by the other device? In fact, do we need Device caps generally? 2 Will all these protocols be compiled in the rockbox statically? Or there will be some kind of "protocol plugins" ? Let's start a discussion about the way USB support will be realised in RockBox --- ---++ USBOTG information Below is information that we need to implement USBOTG. 1 This is a demo program that comes with a Philips ISP1362 evaluation board. It's a DOS program, written with portability in mind and comes with full sources. There's no license included but the readme mentions something about free distribution and modification. * [[%ATTACHURL%/WASABI-1.2b.zip][WASABI-1.2b.zip]]: Example DOS program (with sources) * [[%ATTACHURL%/WASABI-h(20040806-ver1.2c-release).zip][WASABI-h(20040806-ver1.2c-release).zip]]: Latest version of this program (1.2c) received from the developer 2 The ISP1362 is connected to CS3 on the coldfire, we use 0xc0000000 as base address. This results in following register mapping (unconfirmed): * HC data port: 0xc0000000 * HC cmd port: 0xc0000002 * DC data port: 0xc0000004 * DC cmd port: 0xc0000006 3 discovered IO connections (so far, unconfirmed): * GPIO0 pin 0: kept 0 during usbotg, not clear what's on it * GPIO0 pin 28: input from usbhost plug pin 4 (device ID: whether the connected device is slave or host) * GPIO0 pin 29: connected to ID (0 = host, 1 = peripheral) * GPIO1 pin 21 (53): connected to /H_PSW1 (external chargepump control) 4 other IO connections discovered * Pin 55 (vbus) of the ISP1362 is connected directly to pin 1 of the usb connector. In host mode it is used for VBUS sensing (input). * Pin 53 is connected to the DC/DC converter enable pin (charge pump) 5 some usefull links: * [[http://users.ece.gatech.edu/~hamblen/DE2/Datasheets/USB/Embedded%20Programming%20Guide.pdf]] * [[http://www.freescale.com/files/32bit/doc/app_note/AN2645.pdf]] * [[http://www.semiconductors.philips.com/acrobat_download/applicationnotes/AN10022_1.pdf]] * [[http://www.nxp.com/acrobat_download/literature/9397/75015979.pdf]] 6 Progress: * Connect and Disconnect of a device are detected * Device enumeration fails (while retrieving data from the device (testdevice = memory stick) ) --- ---++ Test code Since amiconn got the driver working, no test code here so far.
11 Jul 2006 - 21:06
Example DOS program (with sources)
13 Oct 2006 - 18:19
Latest version of this program (1.2c) received from the developer
ore topic actions
r20 - 04 Jun 2007 - 08:09:51 -
Copyright © by the contributing authors.