These code examples were design to stay in the USB_Dev_Connect() till the device enumerates. If you don't connect the USB cable, it will stay there forever.
If you need to run other parts of the firmware while waiting the user to connect the cable, set up the USB_Dev_Connect() to be non-blocking or with a timeout.
Thanks. The PSoC is on a custom board and the PSoC USB is connected on that board to the USB on another processor that does have USB active as a host. Set a timeout of 2000 and the code gets past that point, but the host processor does not see the PSoC. The host processor is running Linux and lsusb does not show the PSoC USB device.
Have you called USB_Dev_Connect() only once? You would need to keep calling it till the device enumerates.
It also helps to probe the USB lines to see what's going on the bus. Is the USB Host really trying to enumerate the device?
Another thing you can try is to flash the firmware you developed to your custom board into one of the PSoC 6 kits with USB. If the device enumerates using a PC, then probably the problem is related to the USB host.