I am building a project with a custom USB hub attached to one of the RPi USB ports. On the custom hub I attach 7 USB devices powered by their own batteries.
The custom USB Hub is equipped with an external power supply ( exactly 5v) to charge the USB devices and to supply the raspberry through GPIO pins 2 and 6 (I am aware that there is no protection circuit on these pins).
When I power the system from the external (custom USB Hub) supply some (3 of 7) of the attached USB devices are not recognized by the custom USB Hub although the custom USB Hub itself is enumerated correctly by the Raspberry. This happens every single time I try to power the system from the external power supply.
When I remove the external power supply coming from the custom USB hub and I power the raspberry pi and the custom USB Hub through the micro USB connector with a 5v adapter, all the USB devices are recognized correctly every time I power the raspberry.
I cannot understand why this happens. Both power supplies are 5V exactly. The only difference is that in the first case the raspberry is supplied directly through the GPIO pins 2 and 6. Also I think that if there was some issue with the custom hub, it would occur every time and not only with the external supply from the custom Hub
Thank you for your time