Active Topics

 


Closed Thread
Thread Tools
SpeedEvil's Avatar
Posts: 70 | Thanked: 410 times | Joined on Sep 2009 @ Fife, Scotland.
#871
Originally Posted by titan View Post
1) modprobe bq27x00_battery and check /sys/class/power_supply/bq27200-0
3) both are compiled in
ls /sys/kernel/debug/usbmon/
0s 0u 1s 1t 1u
5) always backup and be prepared to reflash
One caveat.
the current exposed by the bq27200 needs multiplied by (20/3.57)mA to get a current.

It's a raw value from the chip.
the '20' is arguable - but is at least more or less reasonable.
This is as the chip really reads out in units of 3.57uV, and the resistor the battery current is applied across is 20mR in the datasheet recommendation.
 

The Following 7 Users Say Thank You to SpeedEvil For This Useful Post:
Posts: 946 | Thanked: 1,650 times | Joined on Oct 2009 @ Germany
#872
FYI:
echo 5 > /sys/module/musb_hdrc/parameters/debug
enables USB debugging in dmesg!
it contains very interesting information incl. line numbers
 

The Following 2 Users Say Thank You to titan For This Useful Post:
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#873
Using egoshin's idea, I got a DisplayLink device working:



This is the same USB monitor shown at the DisplayLink homepage, connected to a N900, in dual screen "clone" mode (more accurately x11vnc, vnc2dl and libdlo, all on the N900). vnc2dl seems to have a 1280x1024 forced resolution.

Basically the requirement of connecting the N900 to a host previously is the key. If you play your cards well you don't even need to patch the kernel (Y-cable, or fully self powered bug, etc.).
I initially though that this requirement came from a g_mass_storage bug that seemingly also happens on the beagleboard, but I was wrong.

Seemingly, DocScrutinizer is right: for some reason after repeating egoshin's steps the N900 seems incapable of closing any USB session, and thus after you unplug it from the host it still believes it's plugged into it, keeping everything powered on. This tricks the driver's OTG state machine into some weirdo state where something starts moving .

Also, with this method you cannot unplug the hub from the N900, as per the above the N900 will keep on thinking it's still connected to it, thus causing mayhem on the kernel.

Last edited by javispedro; 2010-05-17 at 00:50.
 

The Following 26 Users Say Thank You to javispedro For This Useful Post:
qole's Avatar
Moderator | Posts: 7,109 | Thanked: 8,820 times | Joined on Oct 2007 @ Vancouver, BC, Canada
#874
apparently superheroes can be on multiple teams at the same time.

Keep up the good work guys!
__________________
qole.org --- twitter --- Easy Debian wiki page
Please don't send me a private message, post to the appropriate thread.
Thank you all for your donations!
 

The Following User Says Thank You to qole For This Useful Post:
Posts: 946 | Thanked: 1,650 times | Joined on Oct 2009 @ Germany
#875
I cannot replicate this. btw, it is /proc/driver/musb_hdrc

Originally Posted by egoshin View Post
If you want repeat a test, some detailed explanation is here:
C. Connect to PC and answer "PC Suite" to mode question.

D. echo host >/sys/devices/platform/musb_hdrc/mode
You should see in /var/log/syslog a message "twl4030_set_host() after 4030 OTG_CTRL=0x26" - the '2' is a significant.

E. echo H >/proc/drivers/musb_hdrc

F. reattach USB cable from PC to self powered USB hub with memory stick or to external hard disk.

E. Look into /var/log/syslog - You can see a lot of messages and two are most valuable - "Initializing USB Mass Storage driver" and "
USB Mass Storage support registered". And in between you may see "scsi0 : SCSI emulation for USB Mass Storage devices".
 

The Following 2 Users Say Thank You to titan For This Useful Post:
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#876
Originally Posted by qole View Post
apparently superheroes can be on multiple teams at the same time.
Hah, not really a superhero as I discarded all what I was doing to test egoshin's method, which is the first time I've ever seen it moving.

Btw, you might need the patches after all -- seems I had some previous leftover on my N900 (be careful as some settings survive rebooting and reflashing, forcing you to remove the battery).
 

The Following 3 Users Say Thank You to javispedro For This Useful Post:
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#877
Originally Posted by titan View Post
I cannot replicate this. btw, it is /proc/driver/musb_hdrc
Interesting. Sometime I can't do it too but I blamed it to some leftovers and repeat it after removing battery.

But there is still a possibility that some process like BME or DSME intervenes and creates a problem.

BTW, did you see in log a message "twl4030_set_host() after 4030 OTG_CTRL=0x26"?
 

The Following User Says Thank You to egoshin For This Useful Post:
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#878
Originally Posted by javispedro View Post
Using egoshin's idea, I got a DisplayLink device working:



This is the same USB monitor shown at the DisplayLink homepage, connected to a N900, in dual screen "clone" mode (more accurately x11vnc, vnc2dl and libdlo, all on the N900). vnc2dl seems to have a 1280x1024 forced resolution.

Basically the requirement of connecting the N900 to a host previously is the key. If you play your cards well you don't even need to patch the kernel (Y-cable, or fully self powered bug, etc.).
I initially though that this requirement came from a g_mass_storage bug that seemingly also happens on the beagleboard, but I was wrong.

Seemingly, DocScrutinizer is right: for some reason after repeating egoshin's steps the N900 seems incapable of closing any USB session, and thus after you unplug it from the host it still believes it's plugged into it, keeping everything powered on. This tricks the driver's OTG state machine into some weirdo state where something starts moving .

Also, with this method you cannot unplug the hub from the N900, as per the above the N900 will keep on thinking it's still connected to it, thus causing mayhem on the kernel.
To return back from host mode state to normal just do:

echo peripheral >/sys/devices/platform/musb_hdrc/mode

It will cancel VBUS and it immediately stops a session.

BUT! It doesn't do the right stuff about DISK - you should unmount it first, especially if it is not ISO9660 format but some Linux file system.
 

The Following 2 Users Say Thank You to egoshin For This Useful Post:
javispedro's Avatar
Posts: 2,355 | Thanked: 5,249 times | Joined on Jan 2009 @ Barcelona
#879
Originally Posted by egoshin View Post
To return back from host mode state to normal just do:

echo peripheral >/sys/devices/platform/musb_hdrc/mode

It will cancel VBUS and it immediately stops a session.
I couldn't -- as I've noticed though my twl3040 was possibly in some random state -- I wasn't using your kernel.

Last edited by javispedro; 2010-05-17 at 18:21.
 
Posts: 75 | Thanked: 78 times | Joined on Jan 2010 @ Germany
#880
fyi, just found a comparison chart of USB PHY:
http://www.ebv.com/fileadmin/product...sceivers_1.pdf

and checked out the isp1704a because of its similarity to the 1707:
http://www.stericsson.com/product/222222.jsp

It is 100% pin-compatible to the chip in the N900-schematic (which only misses ID and PSW, in comparison to isp1704a, but ID should be present somehow, considering its an OTG chip…)

happy reading
 

The Following 3 Users Say Thank You to hcm 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 10:52.