To save the least uA in one design I leave the VDDUSB unconnected until a powered USB is plugged in. When the 5V from USB is present a transistor enables the 3.3V to reach the VDDUSB pin.The code generated by CubeMX strightly calls MX_USB_DEVICE_Init...