cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

New Contributor II

Hello All,

I'm supposed to be writing firmware for the FX3, but I'm having a hard time getting started. I've tried to pick out the parts of the example code that I need to get a minimal example that I can then build on, but whenever I call CyU3PConnectState(true, false), I get CY_U3P_ERROR_NOT_CONFIGURED.

Now, maybe I've missed a manual, but I have not found a list of things that have to be configured before I can call this function. From the example code, I've gathered that I have to do the following things in the application thread:

  • Call CyU3PUsbStart()
  • Register a setup callback with CyU3PUsbRegisterSetupCallback()
    • For now, mine is called with fast enum, and just returns false
  • Register an event callback with CyU3PUsbRegisterEventCallback()
    • For now, mine does nothing
  • Register an LPM callback with CyU3PUsbRegisterLPMRequestCallback()
    • For now, mine denies all requests
    • I'm not sure if this one's mandatory
  • Set up an event log with CyU3PUsbInitEventLog()
  • Set up descriptors with CyU3PUsbSetDesc()
    • So far I've set up
      • CY_U3P_USB_SET_HS_DEVICE_DESCR
      • CY_U3P_USB_SET_DEVQUAL_DESCR
      • CY_U3P_USB_SET_HS_CONFIG_DESCR
      • CY_U3P_USB_SET_FS_CONFIG_DESCR
      • Several CY_U3P_USB_SET_STRING_DESCR
    • I'm not trying to run it in superspeed yet, so it should be fine that I don't have descriptors for CY_U3P_USB_SET_SS_DEVICE_DESCR, CY_U3P_USB_SET_SS_CONFIG_DESCR, CY_U3P_USB_SET_SS_BOS_DESCR, or CY_U3P_USB_SET_OTG_DESCR yet, right?

That's in addition to regular startup things like configuring the clock, setting up IO, and starting threads that happen before the threads are running.

I assume I've missed something because I'm getting CY_U3P_ERROR_NOT_CONFIGURED. Does anyone have an idea what that might be?

0 Likes
Reply
1 Solution
Moderator
Moderator

Hello,

I could successfully reproduce the issue at my end. I saw that in the defaultDescriptor.c file, the FS descriptors are commented out. Please uncomment the FS descriptors in defaultDescriptor.c file in your project. If FS or HS descriptors are NULL, then the CyU3PConnectState(CyTrue, CyFalse); can return CY_U3P_ERROR_NOT_CONFIGURED. Also, for the switch case DSCR_CONFIG, please change the parameter segmentLength as follows:

segmentLength = pos[2];

By making these changes, I could see that the API CyU3PConnectState(CyTrue, CyFalse); passed without any error code.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
Reply
4 Replies
Moderator
Moderator

Hello,

Everything looks fine from the description that you have shared for using CyU3PConnectState() API. Please share the complete project so that we can try reproducing the issue at our end. Also, please confirm that you are using FX3 SDK 1.3.4 which is the latest version of FX3 SDK.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes
Reply
New Contributor II

The version is 1.3.4, so that should be good.

Here's a temporary link to the project, but it's only good for 24 hours.

https://file.re/2020/08/18/fx3sx2substitute/

Thanks for your help!

0 Likes
Reply
Moderator
Moderator

Hello,

I could successfully reproduce the issue at my end. I saw that in the defaultDescriptor.c file, the FS descriptors are commented out. Please uncomment the FS descriptors in defaultDescriptor.c file in your project. If FS or HS descriptors are NULL, then the CyU3PConnectState(CyTrue, CyFalse); can return CY_U3P_ERROR_NOT_CONFIGURED. Also, for the switch case DSCR_CONFIG, please change the parameter segmentLength as follows:

segmentLength = pos[2];

By making these changes, I could see that the API CyU3PConnectState(CyTrue, CyFalse); passed without any error code.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
Reply
New Contributor II

Ah, well now I feel dumb. Thanks a ton though. You're a lifesaver!

0 Likes
Reply