![]() |
Re: N900 will not allow USB OTG!
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. |
Re: N900 will not allow USB OTG!
Quote:
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. |
Re: N900 will not allow USB OTG!
Quote:
Quote:
|
Re: N900 will not allow USB OTG!
Quote:
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. Quote:
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. |
Re: N900 will not allow USB OTG!
Quote:
Quote:
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. Quote:
|
Re: N900 will not allow USB OTG!
Quote:
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. Quote:
Quote:
Quote:
I will think and continue Saturday. |
Re: N900 will not allow USB OTG!
3 Attachment(s)
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 Quote:
this post will be edited later with additional informations |
Re: N900 will not allow USB OTG!
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.
|
Re: N900 will not allow USB OTG!
Quote:
Quote:
EDIT: "Above AValid, below VBusValid" - sorry for confusion, still sleepy. |
Re: N900 will not allow USB OTG!
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 :) |
All times are GMT. The time now is 04:18. |
vBulletin® Version 3.8.8