Do we know they aren't connected to the +5 in any way? I know next to nothing about the USB at the electrical level.
I've looked into these circuiits quite a bit (for CHDK USB remote reasons, for USB battery charger design reasons, and at least one Arduino clone project) but am not an expert. However, from what I have seen, the data lines are not typically connected to +5V in any functional way. Of course there is always an electrical path but it's high impedance and not necessary or used for USB functionality.
I once read about a USB configuration descriptor (bMaxPower --> Maximum Power Consumption in 2mA units). Could that infer the host controller monitors/limits the current supplied? (and if 0 power monitored, cause it to stop data supply)
USB ports on most PC computers can be configured in software to limit the amount of current they will source. This allows them to meet the USB spec but also charge devices that need more current. That's what the USB configuration descriptor you mentioned refers to. I do not believe there is any minimum current draw specified so there is no official "disconnected" state based on current draw. While it's technically possible for a USB port to be designed to monitor the +5V current draw and disconnect if it falls, it just does not seem likely.
So I retested three of my cameras (a560, G10, a1200) using 1.4.0. I have a toggle switch installed in the +5V line of the USB cable I use between my PC and cameras for CHDK development.
The following sequence works correctly on all three cameras with no disconnections.
$ run -i
___> c
connected: Canon PowerShot A1200, max packet size 512
con> =usb_force_active(1) -- lock USB communications on (+5V line changes do not disconnect USB)
con 1> =set_config_value(121,1) -- enable USB switch operations (switch & controller mode already setup)
con 2> =switch_mode_usb(1) -- switch camera to shooting mode
con 3> =shoot() -- take a picture
con 4>
After the
usb_force_active(1) is issued, I can toggle the +5V inline switch to my heart's content and the connection is not affected. Once the
set_config_value(121,1) is done, toggling the +5V line causes the camera to take a picture (as expected). The chdkptp shoot() command also causes a picture to be taken.
So unless
Josh P has a unique PC that detects current changes on the +5V line, it seems something else must be wrong.
- A bug in the A2500 port ? Wrong USB bit used in mmio? (this seems unlikely looking at the A2500 code ).
- The A2500 USB hardware is different from all my cameras and it kills USB communications on the camera side when the +5V goes away?
- Josh P's USB cable configuration does not just open the +5V line? Or opens the wrong wire entirely ?
- Something else we are assuming but Josh P is not actually doing?
Given that things work properly on all of my cameras, I'm out of other ideas.