Closed Thread
Thread Tools
Posts: 515 | Thanked: 259 times | Joined on Jan 2010
#1031
Originally Posted by titan View Post
I have a possible explanation why it fails: my USB stick requests 200mA
which is the limit of the N900. I'll try again with another less power-hungry device.
I have a HDD that has its own internal power. If someone needs to test host mode with no power I am happy to give it a shot.
 
Posts: 946 | Thanked: 1,650 times | Joined on Oct 2009 @ Germany
#1032
this my HOWNOTTO get USB hostmode working.
I hope someone can replicate MohammadAG's success or at least find out what I did wrong.
Warning: This is only for experts! i2cset may damage your device.

0. you need a USB F/F adapter, the N900 USB cable and a USB device with < 200mA power consumption (verify on your PC)
1. install MohammadAG's kernel (with sarahn's patches + power ignore patch + appropriate configuration), i2ctools (i2cset in PATH) and sysklogd
I have PR1.2 installed, wifi on, bluetooth off, 2.5G, autodisconnect on. egoshin's method works (set to host while connected to PC)
2. boot device with USB cable but without USB device connected
3.
Code:
pcsuite-enable.sh
optional:
Code:
echo USB debug start > /var/log/syslog
and
Code:
echo 10 > /sys/module/musb_hdrc/parameters/debug
4. run the attached script ("sh host.txt -d" shows the state after every step)
5. immediately plug in the USB device
6. check dmesg and /proc/driver/musb_hdrc
7. to retry, unplug USB device,
Code:
killall sh; start bme; sleep 2; cat /proc/driver/musb_hdrc
after about 30sec you should see:
Code:
Status: MHDRC, Mode=Peripheral (Power=20, DevCtl=80)
then go to 4.

my results: (with -d flag)
start: Mode=Peripheral (Power=20, DevCtl=80)
echo H: Mode=Peripheral (Power=20, DevCtl=82)
echo e: Mode=Peripheral (Power=20, DevCtl=82)
echo F: Mode=Peripheral (Power=60, DevCtl=83)
bme stopped: Mode=Peripheral (Power=60, DevCtl=83)
slept 3sec: Mode=Peripheral (Power=20, DevCtl=80)
i2cset: Mode=Peripheral (Power=f1, DevCtl=99)
later: Mode=Peripheral (Power=e1, DevCtl=99)

for the description of the power+devctl flags see drivers/usb/musb/musb_regs.h

with egoshin's method:
Status: MHDRC, Mode=Host (Power=f0, DevCtl=dd)
OTG state: b_peripheral:3; active

dmesg:
Code:
[ 1863.465087] musb_restore_ctx_and_resume  435: restoring register context for musb_restore_ctx_and_resume
[ 1863.465087] rx51_xceiv_power 1
[ 1863.465698] rx51_xceiv_reset
[ 1863.850799] musb_interrupt       1948: ** IRQ peripheral usb0001 tx0000 rx0000
[ 1863.850830] musb_stage0_irq       643: <== Power=e5, DevCtl=99, int_usb=0x1
[ 1863.850860] musb_stage0_irq       829: SUSPEND (b_idle) devctl 99 power e5
[ 1863.874389] musb_interrupt       1948: ** IRQ peripheral usb0001 tx0000 rx0000
[ 1863.874420] musb_stage0_irq       643: <== Power=e1, DevCtl=99, int_usb=0x1
[ 1863.874420] musb_stage0_irq       829: SUSPEND (b_idle) devctl 99 power e1
[ 1871.680358] musb_platform_try_idle  160: b_idle inactive, for idle timer for 7 ms
what MohammadAG got with the same commands (his device is in R&D mode, but it didn't make a difference for me):
Status: MHDRC, Mode=Host (Power=f0, DevCtl=dd)
OTG state: a_host:9; active

with flash plugged in (not powered on)
Status: MHDRC, Mode=Host (Power=e0, DevCtl=99)

with bme:
Status: MHDRC, Mode=Host (Power=20, DevCtl=80)
MohammadAG: OTG state: b_idle:1; inactive

If I first apply egoshin's method I get
Status: MHDRC, Mode=Host (Power=e1, DevCtl=99)
OTG state: b_idle:1; inactive
but again no device is detected.
Attached Files
File Type: txt host.txt (526 Bytes, 436 views)

Last edited by titan; 2010-06-03 at 08:16.
 

The Following 12 Users Say Thank You to titan For This Useful Post:
Bec's Avatar
Posts: 876 | Thanked: 396 times | Joined on Dec 2009
#1033
Thanks a bunch, please keep this post up to date as new info becomes available

I'll bookmark it.

Edit: is it possible that different versions of the firmwares may affect this?
__________________

Last edited by Bec; 2010-06-03 at 07:39.
 
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#1034
titan, just a note, according to lsusb -v my flash drive also uses 200mA.
Doing some tsts after you left I can see what you experience. I'm afraid at the time being you'll have to time it right after running the script.

Anyways, I can still reproduce it
 

The Following User Says Thank You to MohammadAG For This Useful Post:
Posts: 36 | Thanked: 2 times | Joined on Jan 2010
#1035
Originally Posted by titan View Post
...1. install MohammadAG's kernel (with sarahn's patches + power ignore patch + appropriate configuration), i2ctools (i2cset in PATH) and sysklogd...
Where I can download MohammadAG's kernel?
 
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#1036
Originally Posted by KOJAN View Post
Where I can download MohammadAG's kernel?
Apply the patches and build a kernel.
A binary won't be provided till the app is released
 

The Following 4 Users Say Thank You to MohammadAG For This Useful Post:
Bec's Avatar
Posts: 876 | Thanked: 396 times | Joined on Dec 2009
#1037
Isn't it possible to stop any event from happening with the stick connected so that we could use two scripts, one to let the device recognize the connection only when we want it and then "host.txt"?
This could solve our synchronization issue.

Can't the 200mA limit be overridden with kernel patching?
__________________
 
MohammadAG's Avatar
Posts: 2,473 | Thanked: 12,265 times | Joined on Oct 2009 @ Jerusalem, PS/IL
#1038
The 200mA limit is a hardware one.
 

The Following 4 Users Say Thank You to MohammadAG For This Useful Post:
Bec's Avatar
Posts: 876 | Thanked: 396 times | Joined on Dec 2009
#1039
Also since the sate of an USB device being connected becomes a state defined in the ram memory of the device, would it be possible to simply patch (some of) the code in the ram to skip some of the steps?
__________________
 
clasificado's Avatar
Posts: 466 | Thanked: 180 times | Joined on Feb 2010
#1040
@Bec no offense, but this has been requested already, please keep this thread for development only.

use this thread instead for petitions and questions. developers comment there too

http://talk.maemo.org/showthread.php...ight=host+mode
 

The Following User Says Thank You to clasificado For This Useful Post:
Closed Thread

Tags
awesomeness in the works, boulevard of broken deals, host, i am the dealbreaker, inspector gadget lies, mobidapter is a scam, nokia fanbois, otg, over 9000, usb, usbcontrol


 
Forum Jump


All times are GMT. The time now is 01:06.