USB examples hang

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
ToPe_1312931
Level 4
Level 4
10 replies posted 10 questions asked 5 replies posted

I am using Modustoolbox 2.1 and PSoC6 CY8C6247BZI-D54. I have tried the USB CDC Echo and USB Mass Storage Logger applications. Both applications get stuck at the USB_Dev_Connect call in main. I really need the USB component to work. Any suggestions?

t

0 Likes
1 Solution
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

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.

View solution in original post

0 Likes
3 Replies
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

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.

0 Likes

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.

0 Likes

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.

0 Likes