- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am trying to capture SOF events but need to know the ID of the SOF event. I am able to successfully execute code in theCY_U3P_USB_EVENT_SOF_ITP callback.
After CyU3PConnectState, I call
/* Enable SOF events */
CyU3PUsbEnableITPEvent( CyTrue );
I get my events in the callback,
case CY_U3P_USB_EVENT_SOF_ITP:
{
// Always zero.
// uint32_t DEV_FRAMECNT = *((volatile uint32_t*) 0xE0031404 );
uint32_t DEV_FRAMECNT;
CyU3PUsbGetDevProperty ( CY_U3P_USB_PROP_FRAMECNT, &DEV_FRAMECNT ); //also always zero.
if( DEV_FRAMECNT == 0 )
{
gbSOFToggle = !gbSOFToggle;
CyU3PGpioSimpleSetValue( GPIO_SOF_NR, gbSOFToggle );
}
break;
}
According to the datasheet, the register DEV_FRAMECNT should contain the SOF id of the last SOF, but whether I use CyU3PUsbGetDevProperty or read directly from the register, it's always zero.
Do I have to do something to enable the framecnt register?
Solved! Go to Solution.
- Labels:
-
USB Superspeed Peripherals
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please confirm if the device enumerates as USB 2.0 device as CY_U3P_USB_PROP_FRAMECNT is only used for USB 2.0 frame count value. It will return a 32 bit unsigned integer value. Please check the return value of the CyU3PUsbGetDevProperty API. It would return CY_U3P_ERROR_BAD_ARGUMENT if the device is USB 3.0 and CY_U3P_USB_PROP_FRAMECNT is queried.
You can also check the USB speed by calling CyU3PUsbGetSpeed before calling the CyU3PUsbGetDevProperty function.
Rashi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Please confirm if the device enumerates as USB 2.0 device as CY_U3P_USB_PROP_FRAMECNT is only used for USB 2.0 frame count value. It will return a 32 bit unsigned integer value. Please check the return value of the CyU3PUsbGetDevProperty API. It would return CY_U3P_ERROR_BAD_ARGUMENT if the device is USB 3.0 and CY_U3P_USB_PROP_FRAMECNT is queried.
You can also check the USB speed by calling CyU3PUsbGetSpeed before calling the CyU3PUsbGetDevProperty function.
Rashi