I'm working with PSoC 5LP. My code was working properly initially. Now, whenever I program the PSoC, it gives me a message "USB not recognized" and the program hangs on the USBUART_1_GetConfiguration line of the code. Has anybody faced this issue? Please

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

cross mob
1 Solution
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Please try to add an additional USBUART_IsConfigurationChanged() prior USBUART_CDC_Init() as follows.

    for(;;) {

        // Wait for initialization completed

        while (USBUART_GetConfiguration() == 0);

        USBUART_IsConfigurationChanged();       // Ensure to clear the CHANGE flag

        USBUART_CDC_Init();                     // Initialize the CDC feature

        for (;;) {

            // Re-initialize if the configuration is changed

            if (USBUART_IsConfigurationChanged()) {

                break;

            }

This is required for me because Windows issues two SET_CONFIGURATION requests.

Regards,

Noriaki

View solution in original post

0 Likes
4 Replies
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Please try to add an additional USBUART_IsConfigurationChanged() prior USBUART_CDC_Init() as follows.

    for(;;) {

        // Wait for initialization completed

        while (USBUART_GetConfiguration() == 0);

        USBUART_IsConfigurationChanged();       // Ensure to clear the CHANGE flag

        USBUART_CDC_Init();                     // Initialize the CDC feature

        for (;;) {

            // Re-initialize if the configuration is changed

            if (USBUART_IsConfigurationChanged()) {

                break;

            }

This is required for me because Windows issues two SET_CONFIGURATION requests.

Regards,

Noriaki

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hello aaja_4705826

As already mentioned by Noriaki, windows can double send the SET_CONFIGUARTION request. Thus, you need to continuously check in a for loop if the configuration of the device has been changed and reinitialize the USB in case that case. You can do it as follows:

pastedImage_0.png

You can also refer to the USB UART code example for PSoC 5LP: https://www.cypress.com/documentation/code-examples/ce95396-usb-uart-psoc-35lp for  proper implementation.

Best Regards

Ekta

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

aaja,

Has Noriaki or Ekta helped?

Are you willing to share your project?

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

aaja,

If you're using the USBUART in a conventional UART manner and if you're interested, I created a new component called "Term" that should handle many of the Terminal communication interfaces.  As the app designer you can chose to configure "Term" as a standard UART using the standard serial interface or you can configure it to use the USBUART (like that on the CY8CKIT-059).  It uses many of the same API commands as the UART component to make it very easy to configure it either way in your code.

Here's a copy of the link to the component library:

Terminal Support Component Library

I've used this component (and the other components included in the library) on many projects with great success.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes