You can use the USBFS_CheckActivity().
thank you very much for your reply.
But, unfortunately, the function USBFS_CheckActivity() does not exist in my environment because I am using USBUART.
Instead it exists the function USBUART_CheckActivity() but it is not documented inside the datasheet!!!
Why this function is not documented?
However, now I will try to test this function.
USBUART_CheckActivity() function returns the activity status of the bus. It clears the hardware status to provide updated status on the next call of this function. It provides a way to determine whether any USB bus activity occurred. The application should use this function to determine if the USB suspend conditions are met.