maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   N900 will not allow USB OTG! (https://talk.maemo.org/showthread.php?t=31921)

ahmadamaj 2010-05-30 08:09

Re: N900 will not allow USB OTG!
 
first i want to thank everyone for their hard work to make this possible. But the talk her is too technical i couldn't understand everything and the wiki didn't help a lot. I have a few questions, where exactly have you reached guys in making OTG easy to use for everyone? will a normall cable (mini usb - USB) work?

anaskr 2010-05-30 08:48

Re: N900 will not allow USB OTG!
 
well can we have a tutorial on this? step by step? please

tenQ

joerg_rw 2010-05-30 11:31

Re: N900 will not allow USB OTG!
 
Quote:

where exactly have you reached guys in making OTG easy to use for everyone? will a normall cable (mini usb - USB) work?
This isn't OTG. It is NOT easy to use for anybody, as it doesn't exactly work at all yet. If eventually we get to have a plain working hostmode, then a simple adapter A-FtoA-F will suffice, together with your CA-101 cable that came with the phone.

Quote:

well can we have a tutorial on this? step by step? please
As soon as we got something useful to describe in such a step by step HowTo, of course you'll get one and we'll do a BIG announcement on that - we're just not there yet.
So please stay calm and patient, we're working on it. The previous posts might suggest there's more than we actually got, but we are close

[edit]
The HowTo will be very simple btw (just the package is still missing ;-D ):
Quote:

install package hostmode-easy-now
klick the h-e-n icon
from the menu select "hostmode, powered" (a red USB icon will show up in systray area)
attach your USB keyboard, memstick, IrDA adapter, or whatever, using your CA-101 cable and a female-to-female adapter
or
from the menu select "hostmode, charging" (a white USB icon will show up in systray area)
attach your USB peripheral and a USB charger capable to deliver at least 1A, using CA-101, F2F-adapter, and a Y-cable

To stop hostmode, or to switch between powered and charging hostmode, click on systray and select the option you like from the pulldown menu

To finetune hostmode behaviour, click h-e-n icon, and select "config" from menu.
You will see a list of all previously attached USB peripherals that have been configured, plus the currently attached peripheral which is highlighted. On the right you can select for the highlighted item whether your N900, when the peripheral is being plugged in, should automatically change from powered to charging mode (for selfpowered drives etc), and if the screen dim should be disabled. There's also a wildcard item with the name "powered mode" in the list, which will have "disable dim" option only, to disable dimming of screen as long as device is in powered hostmode (you might not care about saving screen backlight power, while USB blasts out 5V to a hungry peripheral)
There's also an option to make indicator LED flash red during powered hostmode, to warn you about the power drain.

hostmode-easy-now will power up the USB and enter hostmode as soon as you click the h-e-n icon and the main menu shows up. Depending on your selection, it will switch to hostmode,charging, or revert to whatever was the USB state before on selecting "config".
When hostmode wasn't enabled when you click the h-e-n icon, and the automatic enabling of powered hostmode makes an already attached peripheral become visible for N900, and if this peripheral is a configured item, then the hostmode and other option are set according to the config for that item, and the main menu is closed immediately. Put simply, if you first attach a known and configured device, then clicking h-e-n is all you need to do to make it start.

hcm 2010-05-30 15:55

Re: N900 will not allow USB OTG!
 
1 Attachment(s)
I used some perl magic to grant DocScrutinizers wish of having DBG-statements in every function in usb/.

just call the attached perl-script with a parameter (either a single .c file or a directory => it will recursively process each .c file).

the script makes a backup of each .c file and adds DBG-statements in every function and before every return-statement or end of function.

ATTENTION: the script uses the program "indent" to generate homogeneous code to avoid parsing errors (the "parser" is not very foolproof). The program must thus be installed, and the line-numbers may not be the same as in the original source-files.

sarahn 2010-05-31 08:16

Re: N900 will not allow USB OTG!
 
2 Attachment(s)
I am typing this in from a USB keyboard hooked up to an external hub that I got working with just force host. It was not via the HNP trick.

I have tried different hubs connected directly. I can also unplug the keyboard, plug one hub into the other, plug in the keyboard to the cascaded hub, and use it from there. Unfortunately detecting disconnects / connects after initial enumeration is not 100%reliable.

Mass storage doesnt seem to be working for reasons I dont know yet. Mass storage devices are detected as shown with lsusb.

I have had a keyboard and a keyboard/touchpad plugged in and operating at the same time - this is what I have available right bow other than the mass storage.

I tried connecting my keyboard directly without the hub and it showed up in lsusb but did not work, no characters typed showed up on the screen.

I am using a power injection cable. It also works with the bq power instead of power injection, but a powered hub still seems to be required.

The additional changes to what I did before that seem relevant are disable usbcore autosuspend and then making the musb SUSPEND interrupt a noop when forcing host mode. Also, disabling the usb whitelist appears to causes issues with the gadget driver, grep your syslog for "cut". So for now it seems better to leave whitelist configured but really allow everything.

The switch to host is not 100% reliable, probably due to ulpi timeouts. These happen for reasons I don't know.

[edit] As it stands host mode only works with connecting the id pin first. The interrupts that happen when applying power first cause a session to be opened as a peripheral, which interferes. Working on it.

joerg_rw 2010-05-31 12:58

Re: N900 will not allow USB OTG!
 
sarahn
extremely encouraging results, indeed. :-)
You have any idea why we need a hardware ID_GND and can not fake it?

would you mind posting a proper diff so we can know what exactly you patched in kernel and also which kernel that is based on, please.
A super nice-to-have of course would be if you could apply hcm's pearl script to the whole usb folder (of course after you created the diff), and also supply the result of that, so we finally get an idea what's happening in detail when forcing host mode, function by function - kind like a trace.

many thanks
jOERG

Nokia7Linux 2010-05-31 13:16

Re: N900 will not allow USB OTG!
 
I think you guys should see this:

http://img14.imageshack.us/img14/5870/40775082.png

http://img139.imageshack.us/img139/7259/64147687.png

It is still in beta stages...

MohammadAG 2010-05-31 13:23

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by Nokia7Linux (Post 691712)
I think you guys should see this:

It is still in beta stages...

Quite ironic to see the pics watermarked since...
http://talk.maemo.org/showthread.php?t=31921&page=91

Chrome 2010-05-31 13:34

Re: N900 will not allow USB OTG!
 
Quote:

Originally Posted by Nokia7Linux (Post 691712)
I think you guys should see this:

It is still in beta stages...

MohammadAG took these pictures, and i credited him in m4a thread.. No need to post them with the watermark :)

imperiallight 2010-05-31 14:33

Re: N900 will not allow USB OTG!
 
Quote:

I have had a keyboard and a keyboard/touchpad plugged in and operating at the same time - this is what I have available right bow other than the mass storage.
Awesome, does the touchpad work properly?


All times are GMT. The time now is 13:02.

vBulletin® Version 3.8.8