Reading EP0 OUT data with PSoC 4200L devices

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

cross mob
WaPi_297581
Level 2
Level 2
Welcome! 5 questions asked First question asked

The USBFS_ReadOutEP() API doesn't allow you to read from EP0:

if ((pData != NULL) && (epNumber > USBFS_EP0) && (epNumber < USBFS_MAX_EP))

However, the Windows/Linux bundled boot mode drivers for my boot mode device requires reading data from EP0.  How can this be done?

0 Likes
1 Reply
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Kindly refer to Example on how to use the USB control EndPoint EP0 for information on how to handle EP0. I repeat the last post here again:

For the functions like USBFS_ReadOutEP(), the valid value of endpoint number ranges from 1 to 8. You cannot give 0 for the endpoint number parameter in it.

As already mentioned by Len you can use the USBFS_EP_0_ISR_ExitCallback() and USBFS_EP_0_ISR_EntryCallback() ISR's located in the USBFS_dvrc.c . These ISR's are triggered to handle control transfers directed to endpoint.

To use these ISRs you need to define  USBFS_EP_0_ISR_ENTRY_CALLBACK (or USBFS_EP_0_ISR_EXIT_CALLBACK) in the cyapicallbacks.h as shown in the image below:

pastedImage_0.png

Then define the USBFS_EP_0_ISR_EntryCallback() function in the main.c to perform the desired function.

0 Likes