Author Topic: Usb Power Issues  (Read 3404 times)

louigi600

  • Sr. Member
  • ****
  • Posts: 471
    • View Profile
Usb Power Issues
« on: May 01, 2008, 06:35:58 am »
Although I've made hardware changes to my C1k (to be able to power upto 500mA to the usb port and I've terted it with pdaxrom to be effective) debian is refusing to power up wireless device dew to excessive power consumtion (probabbly calculated on USB OTG power sepecifications).

Anyone know how to correct the behaviour fo my 500mA capable hardware ?

Foud this workaroud:
https://www.oesf.org/forum/index.php?showto...&hl=pegasus
which is not that straightforwars to apply:
I mean lsusb shows bus address to be 1 and not 1-2.
Althought dmesg shows some messages about 1-2 ... I find it difficult to correlete what lsusb shows and the content of the /sys/bus/usb subtree.
lsusb shows bus 1 and device 8 ... I guess that bus1:1 becomes 1-1 and 1:8 becomes 1-2 a bit like scsi devices ?
anyway with some doubts whether it's the right thing to di I dot the zd1211 to power up correctly.

Anyway I would still prefer instrucnting that my hardware supports normal USB 500mA specification.
« Last Edit: May 01, 2008, 12:33:37 pm by louigi600 »
Regards
David

SL-c760*  pdaXrom latest
SL-c860    pdaXrom latest ;-)
SL-c1000  pdaXrom Latest
Acer Aspire One running slackware and Clash
Toshiba AC100 running ARMedslack and Clash

*with some hardware problems but good for testing

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Usb Power Issues
« Reply #1 on: May 15, 2008, 04:45:56 am »
I agree that the bConfigurationValue trick isn't really appropriate for more than initial debugging. There are a couple of other options:

1) Recompile the kernel with the new current limit, or
2) Add udev rules for each device that exceeds the kernel power limit.

The kernel limit is set in spitz.c, and by default is at 150mA. Fixing this is the best all-round option, except that compiling a Z kernel is a pain.

The udev option is the proper way of applying the bConfigurationValue trick, and only has to be done once for each device. You want to make a new file called 99-usbpower.rules or similar in /etc/udev/rules.d, containing rules like this (note the =='s and ='s):

Code: [Select]
SUBSYSTEM=="usb", ATTR{idVendor}=="vendorid", ATTR{idProduct}=="productid", ATTR{bConfigurationValue}=1Then do a "udevcontrol reload_rules". The rule will forcibly select device configuration 1 whenever the usb device with the specified vendor and product id is inserted.

I've been using the udev option for my Huawei 3G modem. It's too bad I didn't use a small enough resistor when doing the usb power mod, because I still can't get enough current - it's enough to initialise the device now, but not enough to turn the transmitter on! I'm going to have to pull my Z apart again *shudder*
« Last Edit: May 15, 2008, 04:46:55 am by pelrun »
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

radiochickenwax

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Usb Power Issues
« Reply #2 on: July 14, 2008, 01:56:05 am »
Quote from: pelrun
The kernel limit is set in spitz.c, and by default is at 150mA. Fixing this is the best all-round option, except that compiling a Z kernel is a pain.

I'm guessing this is line 466?   What's a reasonable number to put here?  I'm thinking 500mA is too much... gonna go with 250 for now

*edit*  rebuilt kernel with this change, but waiting for native compile of FFMPEG to finish (or fail) before I reflash



Quote from: pelrun
too bad I didn't use a small enough resistor when doing the usb power mod, because I still can't get enough current - it's enough to initialise the device now, but not enough to turn the transmitter on! I'm going to have to pull my Z apart again *shudder*

Do you have any documentation (online) about your usb mod?
« Last Edit: July 14, 2008, 02:32:50 am by radiochickenwax »
ZAURII:    sl-6000 : (temporarily) bricked pdaxrom b1   ||   sl-c3200 : yonggun/Debian-EABI
OTHERS:  htc-excalibur,  axim x5,  ipaq 4355, (still trying to find useable linux setups)
thinking about gumstix to replace/augment zaurus

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Usb Power Issues
« Reply #3 on: July 15, 2008, 02:41:53 am »
There's no point in changing the kernel if you haven't done the power mod; the hardware will forcibly power off any USB device which tries to draw more than that. If a usb device is requesting more current than it actually draws then it's better to override it using a udev rule.

The power mod involves changing the resistor which sets the overcurrent protection limit (currently at 150mA) - the info is buried somewhere in albertr's internal bluetooth/wifi mod thread.
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

radiochickenwax

  • Full Member
  • ***
  • Posts: 158
    • View Profile
Usb Power Issues
« Reply #4 on: July 15, 2008, 04:41:57 am »
Quote from: pelrun
There's no point in changing the kernel if you haven't done the power mod;

(haven't done power mod)
whoops..  oh well, I'm on a rebuild kick without a roadmap, and this is what happens.

Quote from: pelrun
The power mod involves changing the resistor which sets the overcurrent protection limit (currently at 150mA) - the info is buried somewhere in albertr's internal bluetooth/wifi mod thread.

https://www.oesf.org/forum/index.php?showto...3562&st=360

Wow!  (Can't believe I missed so much of this)
That's a pretty long thread.   (365 posts) You didn't do the CF/usb mod I take it, just the OTG mod?
ZAURII:    sl-6000 : (temporarily) bricked pdaxrom b1   ||   sl-c3200 : yonggun/Debian-EABI
OTHERS:  htc-excalibur,  axim x5,  ipaq 4355, (still trying to find useable linux setups)
thinking about gumstix to replace/augment zaurus