Basic question, but I can't seem to find the answer anywhere.
Is there a difference between the USB ports?
Can power be provided through any of them?
Can I connect one to a USB charger and the other one to the computer simultaneously?
Micro USB vs USB host on cape
- Edited
So this is about BelaMini I assume.
trocado Is there a difference between the USB ports?
Yes. In principle, each of those can be used as either a HOST or DEVICE or OTG (automatic selection) and are interchangeable, however there are differences on how they are set up by default and how each works.
The micro USB port on the PocketBeagle (USB0) is already set up as OTG, which means that with an appropriate cable (e.g.: https://www.amazon.co.uk/StarTech-com-5in-Micro-Host-Adapter-Black/dp/B00K4RZQWQ/ref=sr_1_2_sspa) you can connect a USB Device to it. You can also force it into HOST mode if you are using some weird cable that doesn't do it automatically.
The USB A port on the BelaMini cape (USB1) is by default set as HOST, but it can be changed in software so that it is forced to act as a DEVICE.
trocado Can power be provided through any of them?
Can I connect one to a USB charger and the other one to the computer simultaneously?
Because of a questionable* design choice, the power lines from USB0 and USB1 are actually connected together (via a ferrite bead IIRC), which means that yes, you could use either for power (maybe need a non-standard cable for USB1? Not sure); however this also means that if you have power on both of them at once, the two power supplies will "fight" each other, leading to excessive current consumption and unneeded heating. So the recommendation is to only power one of the two at once. If you want to power the board from a different power source from the USB micro, I recommend using another of the VIN pins available: you can plug 5V into SYS.VIN (P1.01) or BAT.VIN (P2.14), using a nearby ground. These can be safely connected at the same time as the USB micro on USB0. Pinout is here.
* the reason behind this choice is to make it so that you can power a USB accessory on USB1 while you are powering the board from USB0 without its current going through the power management IC. This also means that once you disconnect your micro USB cable from USB0, the device on USB1 will not be powered, even if you applied power on SYS.VIN or SYS.VBAT. If you need power on USB1 when running from SYS.VIN or SYS.VBAT, then that needs some rewiring on the cape.
Now a question for you:
why do you want to do power the board from the USB1 port when you already have USB0 connected? What's the use case?
Thank you so much for the detailed answer!
The use case would be to set up things up from the computer, disconnect the usb cable, and have Bela keep doing its thing. I was having trouble running a program on boot up (it's working now...), and I was planning for a worst-case-scenario.