Closed Thread
Thread Tools
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#761
OK, good news:

1. I was able to set hardware in HOST mode with VBUS on. I don't remember for a moment - was it via TWL4030 VBUS boost or via "i2cset" usage (it is night in CA). However, looking into log I think - VBUS setup was a result of boost in TWL4030.
ARM CPU USB started work as HOST, recognized the new device attachment (I used USB memory stick) and tried to communicate.

2. musb driver was able to work in HOST mode which was triggered by CONNECT interrupt and tried to assign HUB, enumerate device and so on.

Not very good news (yet )

3. session init with USB stick failed and I don't know yet - is it because of I/O error, USB stick underpowered or some protocol violation.

EDIT: - protocol error, msg type doesn't correspond to expected.

Note: I didn't switch ARM CPU USB to FORCE_HOST mode - just played with VBUS supply and tried use 'host' and 'H' commands.

Note2: don't believe file /sys/devices/platform/musb_hdrc/vbus - it says 'Vbus=off" permanently (programming error).

Note3: VBUS on discharge battery - 45min and 1/4 battery gone. But screen was constantly ON and intensive work in X-Term too.

Last edited by egoshin; 2010-05-07 at 07:22.
 

The Following 19 Users Say Thank You to egoshin For This Useful Post:
SpeedEvil's Avatar
Posts: 70 | Thanked: 410 times | Joined on Sep 2009 @ Fife, Scotland.
#762
Originally Posted by egoshin View Post
OK, good news:

1. I was able to set hardware in HOST mode with VBUS on. I don't remember for a moment - was it via TWL4030 VBUS boost or via "i2cset" usage (it is night in CA). However, looking into log I think - VBUS setup was a result of boost in TWL4030.
ARM CPU USB started work as HOST, recognized the new device attachment (I used USB memory stick) and tried to communicate.
It was my understanding that the twl4030 capacitor for boost mode was not there (in the schematic at least).

If this is the case, then VBUS is going to be very low - under 3V?
This might cause some semblance of activity on the port - but will not actually work.

External supply would be an easy way to test it. Or of course a voltmeter to verify.

Last edited by SpeedEvil; 2010-05-07 at 08:48.
 

The Following 3 Users Say Thank You to SpeedEvil For This Useful Post:
Posts: 82 | Thanked: 214 times | Joined on Jan 2010 @ Cape town
#763
Originally Posted by SpeedEvil View Post
It was my understanding that the twl4030 capacitor for boost mode was not there (in the schematic at least).
Mine too, in fact, a post earlier by joerg seems to state exactly that:

We are missing some capacitor to put TWL4030 GAIA boostmode to work, but N1140 bq24150 USB Bat Charger chip is perfectly suited for that. The i2cset cmd you're asking about does exactly that: enable boost mode (aka supply VBUS) in bq24150
 

The Following 2 Users Say Thank You to cb22 For This Useful Post:
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#764
Originally Posted by SpeedEvil View Post
It was my understanding that the twl4030 capacitor for boost mode was not there (in the schematic at least).

If this is the case, then VBUS is going to be very low - under 3V?
I didn't attach multimeter - my has too thick probes.
But VBUS voltage is confirmed by reading both - TWL4030 and 1704 registers:

A. File /sys/class/i2c-adapter/i2c-1/1-0048/twl4030_usb/vbus shows 1. The same value is in this file during attachment of PC USB host port or charger. It is from STS_HW_CONDITIONS of TWL4030.

B. ARM CPU USB module, DevCtl shows 0xd5 which means "VBUS above AValid, below VBusValid" or in my mind: 0.8v-1.4v < VBUS < 4.4v-4.6v. So, it should be enough, at least from 1707 point of view.

This might cause some semblance of activity on the port - but will not actually work.
USB stick tried to establisjh attention via pullup/pulldown play with D+/D- in my understanding (but I don't know USB line protocol details). ARM CPU USB triggered interrupts about session start and under "full speed" protocol and indicated my "host session valid". And that happened only after a physical attachment of USB stick.

However, morning analysis shows that ARM CPU USB controller stayed as B-device (high order bit in DevCtl=0xd5). That probably means that N900 tries to swap roles with other side (became 'host') via HNP but USB stick doesn't understand it. (I used 'echo H >/proc/drivers/musb_hdrc')

Or it may be a physical error - morning analysis shows that N900 can't read anything from USB stick. It transmits but read stops due to timeout. (BTW, do we need to swap D-/D+ if N900 is a host?)

Equally, it is possible that some 1704 configuration must be changed. I found the same pullup/pulldown resistor table in TWL4030 description and driver setup it's properly for TWL4030 but in incorrect way for 1704 during regular USB run as a B-device disk.

And finally, you may be right - VBUS voltage is not enough to power USB stick. I will try with external hard disk next day.

Last edited by egoshin; 2010-05-07 at 16:03.
 

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
#765
Originally Posted by egoshin View Post
The cable/hw patchwork is not enough, some additonal activity in driver is needed. I am working on it.
Yes, I was borking the driver.

Originally Posted by egoshin View Post
configuration of 1707 DM/DP pulldown registers is done in reverse with document. What is it - document error or software bug which does still not produce a problem? I don't know but try to find, it actually changes the resitor values only.
Where are you seeing that? All I can see is that after Power on Reset http://mxr.maemo.org/fremantle/sourc...omap2430.c#420 id pin sampling and both dp & dp pulldowns are enabled (seemingly to enter OTG mode?).

When vbus is detected by twl3040 twl3040-usb fires a sysfs-node changed event (linkstat) which I believe bme is listening to, which then proceeds to read the charger sysfs node thus causing musb_verify_charger to run thus causing DP & DM pull downs to be disabled and strong pull up on DP to be enabled (thus entering gadget/peripheral mode).

Note that configuring twl3040 via i2c as the twl3040-usb driver does is for all practical purposes as I understand a NOP (save for reading/writing registers related to pins it has connected, like vbus or id). Only valid configuration of isp1707 is via ULPI.

Originally Posted by egoshin View Post
Is VBUS voltage needed for 1707 to support ARM CPU USB in HOST mode? I am not familiar with USB protocol details yet to answer it fast.
No; for example self powered hubs should work without VBUS on host. Since there are quite a few cons to having the vbus pump enabled (bme will have to be lied at, possibly high battery consumption, ...) I suggest we center on enabling host mode _without_ vbus. It should be possible.

Last edited by javispedro; 2010-05-07 at 16:20.
 

The Following 2 Users Say Thank You to javispedro For This Useful Post:
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#766
Originally Posted by javispedro View Post
Where are you seeing that? All I can see is that after Power on Reset http://mxr.maemo.org/fremantle/sourc...omap2430.c#420 id pin sampling and both dp & dp pulldowns are enabled (seemingly to enter OTG mode?).
Table 14.
Operating states and their corresponding resistor settings
(only DP_PULLDOWN and DM_PULLDOWN are shown here):
...
Host high-speed ... 1b 1b
...
Peripheral high-speed ... 0b 0b
...
OTG device peripheral high-speed ... 0b 1b

You say you see both are enabled. Me too. But device is not in Host mode, right? At least TWL4030 has both zeroes until switch to host mode.


When vbus is detected by twl3040 twl3040-usb fires a sysfs-node changed event (linkstat) which I believe bme is listening to, which then proceeds to read the charger sysfs node thus causing musb_verify_charger to run thus causing DP & DM pull downs to be disabled and strong pull up on DP to be enabled (thus entering gadget/peripheral mode).
I put a couple of debug prints in musb_verify_charger(). Never seen once. Will try to see it with a regular charger.

Note that configuring twl3040 via i2c as the twl3040-usb driver does is for all practical purposes as I understand a NOP (save for reading/writing registers related to pins it has connected, like vbus or id).
To make TWL4030 configuration working I did some tricks - power registers are protected and you can't change some TWL4030 USB registers while it is sleeping.


No; for example self powered hubs should work without VBUS on host. Since there are quite a few cons to having the vbus pump enabled (bme will have to be lied at, possibly high battery consumption, ...) I suggest we center on enabling host mode _without_ vbus. It should be possible.
Good!
I will think and continue Saturday.
 

The Following 2 Users Say Thank You to egoshin For This Useful Post:
Posts: 306 | Thanked: 566 times | Joined on Jan 2010 @ Romania
#767
from datasheet of 1704
"8.7.2.1 VBUS valid comparator
This comparator is used by hosts and A-devices to determine whether the voltage on
VBUS is at a valid level for operation. The ISP1704A minimum threshold for the VBUS valid
comparator is 4.4 V. Any voltage on VBUS below this threshold is considered invalid.
During power-up, it is expected that the comparator output will be ignored.'"


if otg controller expect a valid vbus on isp1704 vbus probe pin maybe this is the reason for timeouts

do a voltage check with a voltmeter . if vbus is below 3.3V this voltage come from isp1707 internals.
............
OTG controller ALWAYS start a FS session even if a HS device is attached .
................
check also usb documentation especially appendix C you will find some C code at de end of document

@javispedro
Or it may be a physical error - morning analysis shows that N900 can't read anything from USB stick. It transmits but read stops due to timeout. (BTW, do we need to swap D-/D+ if N900 is a host?)
NO . this setting is for swapping receptacle on the other side of the printed board to avoid datalines cross over and traces be routed on one single board layer.


this post will be edited later with additional informations
Attached Images
   

Last edited by blue_led; 2010-05-07 at 17:57.
 

The Following 3 Users Say Thank You to blue_led For This Useful Post:
daperl's Avatar
Posts: 2,427 | Thanked: 2,986 times | Joined on Dec 2007
#768
You guys should see some interesting output when plugged into that DC <-> uB adapter dongle. My n900 "sounds" likes it trying to talk to that thing constantly. Maybe it's time to get an extra one of those and crack it open.
__________________
N9: Go white or go home
 

The Following User Says Thank You to daperl For This Useful Post:
Posts: 992 | Thanked: 995 times | Joined on Dec 2009 @ California
#769
Originally Posted by blue_led View Post
from datasheet of 1704
"8.7.2.1 VBUS valid comparator
This comparator is used by hosts and A-devices to determine whether the voltage on
VBUS is at a valid level for operation. The ISP1704A minimum threshold for the VBUS valid
comparator is 4.4 V. Any voltage on VBUS below this threshold is considered invalid.
During power-up, it is expected that the comparator output will be ignored.'"


if otg controller expect a valid vbus on isp1704 vbus probe pin maybe this is the reason for timeouts
Hm-m... But it definitely transmits... Or it may be a comparator for validity check to supply a valid VBUS from 1707?

do a voltage check with a voltmeter . if vbus is below 3.3V this voltage come from isp1707 internals.
I don't think so - until I programmed TWL4030 I didn't see any VBUS voltage above VSESSVALID (0.8v - 1.4v) or in ARM CPU USB description - "Above session end, below AValid".

EDIT: "Above AValid, below VBusValid" - sorry for confusion, still sleepy.

Last edited by egoshin; 2010-05-07 at 17:17.
 

The Following 2 Users Say Thank You to egoshin For This Useful Post:
Posts: 306 | Thanked: 566 times | Joined on Jan 2010 @ Romania
#770
i think all tests must be done respecting this minimals :
--without bme running
--charger detection disabled inside 1707
-- 5V applied from external source to 1707
this make valid vbus for A state machine

a hacked cable is needed
 

The Following User Says Thank You to blue_led 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

Thread Tools

 
Forum Jump


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