WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: max_usb_current on piCore  (Read 3377 times)

Offline richarde

  • Newbie
  • *
  • Posts: 10
max_usb_current on piCore
« on: July 04, 2017, 03:35:27 AM »
Hi,

I'm reading (https://www.raspberrypi.org/forums/viewtopic.php?p=594183#p594183) that the usb power output of my raspberry pi b+ can be increased by setting adding an option to /boot/config.txt. Apparently, this has the effect of setting a GPIO pin high, which turns on a FET, which increases the current flowing out of the control pin of a current limiter. Sounds great, and I was hopeful it might address some issues I was seeing with connected devices (more of that in another post)....except...when I investigate the PCB, I see that the GPIO pin is already high, and the FET is already switched on. I tried to find a point in the boot sequence at which the GPIO line went high, but it seems to be high all of the time.
I've looked at config.txt and I cannot find an entry for max_usb_current. Indeed I have not been able to find any reference to max_usb_current in the whole of piCore 8.1.5.

My question is: Am I being overly optimistic in thinking that there is more power that can be provided by software configuration to connected USB Devices on my Raspberry Pi B+? In other words, does piCore 8.1.5 already configure the USB outputs for 1.2A total current available?

There are other hardware techniques described at http://hackaday.com/2015/04/06/more-power-for-raspberry-pi-usb-ports/. But 1.2A should be sufficient for my application and I was hopeful I could achieve that via software configuration.

Thanks,
Richard


Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 673
Re: max_usb_current on piCore
« Reply #1 on: July 04, 2017, 05:40:43 AM »
The config.txt is not picore specific, it's the raspberry pi's firmware/kernel configuration settings file.
In the raspberry pi's forum you can read how this file can be set.

https://www.raspberrypi.org/documentation/configuration/config-txt/

Also this site have lots of good stuff.

http://elinux.org/RPiconfig

Offline richarde

  • Newbie
  • *
  • Posts: 10
Re: max_usb_current on piCore
« Reply #2 on: July 04, 2017, 06:28:48 AM »
Hi patrikg,

Thanks for this.

I don't think piCore supports vcgencmd, so its difficult for me to apply the guidance in the links you provided. I would love to know how to display config settings in piCore.

I guess my question is directed at whoever built piCore 8.1.5: Is the USB configured for 1.2A current output by default?

Thanks,
Richard

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 673
Re: max_usb_current on piCore
« Reply #3 on: July 04, 2017, 06:36:09 AM »
Why not just add that line as you suggest.

Also as in the site http://elinux.org/RPiconfig#USB_Power
USB Power
max_usb_current

Together with the raspberry PI B+ a new config.txt setting was introduced.

max_usb_current=1
when adding this line the USB power manager will change its output current limit (for all 4 USB ports combined) from 600mA to double that, 1200mA.

max_usb_current=0
is the default, and limits the USB current to 600mA.

Make sure your power supply (and microUSB cord) are up to the task of delivering the extra 0.6A current.

« Last Edit: July 04, 2017, 06:42:03 AM by patrikg »

Offline richarde

  • Newbie
  • *
  • Posts: 10
Re: max_usb_current on piCore
« Reply #4 on: July 04, 2017, 07:21:57 AM »
I guess I wasn't clear.

My point is that investigation of the signals on the PCB indicates that the GPIO is already set even in the absence of this option. There is no benefit me trying to activate a feature that is already active. That is what I am endeavouring to confirm.

I have searched and searched the files on this piCore distribution and can find no existing reference to max_usb_current. I can see no software configuration reason why that GPIO line should by set high. Yet it is set high.

I suppose that it is possible that there is a hardware fault on the PCB that is holding the GPIO line high. But before assuming that, I wanted to contact someone who might have deliberately set the GPIO high as part of the board initialisation. If they tell me that its already set (or I can find a command that will display the config settings), then I know I am wasting my time trying to find a software way to increase the USB power output beyond what I currently have.

>Why not just add that line as you suggest.
Adding a command to set the GPIO line high won't help if the line is already set high by some other mechanism.
I suppose that I could try adding a command that takes the GPIO line low (max_usb_current=0) but
- it may well be overridden by whatever it is that is currently setting the line high
- i don't want 0.6A, I want 1.2A

As I say, I am looking for confirmation that piCore 8.1.5 does not comply with http://elinux.org/RPiconfig#USB_Power, i.e. confirmation that the default usb power current for piCore 8.1.5 has been deliberately set to be 1.2A (corresponding to max_usb_current=1).

Thanks,
Richard
« Last Edit: July 04, 2017, 07:24:39 AM by richarde »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: max_usb_current on piCore
« Reply #5 on: July 04, 2017, 07:25:58 AM »
I don't think piCore supports vcgencmd,
vcgencmd  is provided by  rpi-vc.tcz .
Download a copy and keep it handy: Core book ;)

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 673
Re: max_usb_current on piCore
« Reply #6 on: July 04, 2017, 07:33:34 AM »
I presume that the "max_usb_current=1" in the config.txt file just config the firmware on the raspberry pi.
To add more power to the usb port, to take away the power cap.

It's not the power of the gpio pin's.

It's only the power of the usb ports, so you could power some usb Peripherals like usb Hard Discs with it.

May I ask what you doing ?
What do you want to do ?
Just add some mosfet to the gpio pin to add more power.

http://elinux.org/RPi_GPIO_Interface_Circuits

« Last Edit: July 04, 2017, 07:42:52 AM by patrikg »

Offline richarde

  • Newbie
  • *
  • Posts: 10
Re: max_usb_current on piCore
« Reply #7 on: July 04, 2017, 08:09:04 AM »
>I presume that the "max_usb_current=1" in the config.txt
No it is not. And yet the GPIO line to the FET is high. That is my whole point.
Please see http://hackaday.com/2015/04/06/more-power-for-raspberry-pi-usb-ports/ for electrical details of how the current limiter operates.

I'm still not making myself clear. I'm not sure how to best restate.

I want to draw 1.2A from the USB connections on the Raspberry Pi B+ running piCore 8.1.5.

I had expected (as indicated by http://elinux.org/RPiconfig#USB_Power) that the default setting for piCore on Raspberry Pi B+ was 0.6A. If so, then it is worthwhile me re-configuring the system for 1.2A by adding max_usb_current=1 to config.txt.

However, I have probed onto the pins of the FET and found that, even with no mention of max_usb_current anywhere on the boot partition of piCore, the GPIO line is already high. That would suggest that I already have 1.2A available from the USB connectors and that messing with software configurations is going to be of no benefit.

Since my observations contradicted what I read at http://elinux.org/RPiconfig#USB_Power, I felt that it was best to try to contact those who might know more about the inner workings of piCore to see if there was an explanation for my observations. Can anyone explain why the GPIO line (that controls the FET that controls the USB output current) is set high when piCore 8.1.5 start on a Raspberry Pi B+?

But I don't seem to be able to make myself clear. I'm sorry about that.


Offline richarde

  • Newbie
  • *
  • Posts: 10
Re: max_usb_current on piCore
« Reply #8 on: July 04, 2017, 09:14:01 AM »

Quote
vcgencmd  is provided by  rpi-vc.tcz .

thanks

tc@HubLink2:~$ sudo vcgencmd get_config int
audio_pwm_mode=1
config_hdmi_boost=5
disable_auto_turbo=1
disable_commandline_tags=2
enable_uart=1
force_eeprom_read=1
force_pwm_open=1
framebuffer_ignore_alpha=1
framebuffer_swap=1
hdmi_force_cec_address=65535
init_uart_clock=0x2dc6c00
lcd_framerate=60
pause_burst_frames=1
program_serial_random=1
ramfsaddr=-1
temp_limit=85


Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 673
Re: max_usb_current on piCore
« Reply #9 on: July 04, 2017, 10:14:22 AM »
I tested on my own raspberrypi, with the setting.. but can't find the setting when
using the vcgencmd get_config int command, but if i don't have this max in the file
my usb hd can't be powered by my raspb.

I also find this:
https://www.modmypi.com/blog/boost-usb-current

But you have to mount the fat part to edit the config.txt file.

Also find this on raspb own forum:
https://www.raspberrypi.org/forums/viewtopic.php?p=594183#p594183

« Last Edit: July 04, 2017, 10:25:29 AM by patrikg »