I made a device with CC2538.
I planned that the device will be powered by a lithium battery with automatic powered by a port USB (through the LDO 3.3V) when the cable is connected. To this was added the power switch FETs.
But I was faced with the fact that the battery power (VDD) passes through the internal circuitry of CC2538 to VDD_USB (pin 4). If VDD 3V, the VDD_USB about 2.2V (this is similar to passing through the diode).
Thus, when powered by a battery there are additional current from pin 4 through the participation of circuits connected to the same conclusion (eg back through LDO). This not only leads to an increase consumption (if CC2538 chip consumes less 2mkA, the extra "leakage" can add 10mkA and more.), but also creates problems for the power switch (have to complicate the scheme, so that when the battery power is turned off the output VDD_USB).
If the internal USB module is disabled, the voltage at the output VDD_USB (PIN 4) no.
However, I would like the CC2538 when connected to the port USB, can automatically switch to power from the port and through the exchange. Is it possible to do without additional elements only by software (eg, specifically configure the module USB)?