How to send a code to PC Host software  in UVC firmware

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

cross mob
Anonymous
Not applicable

Hello,

   

  In my UVC firmware, when a GPIO key pressed, in the GPIO interruption function I want to send a code like 0xFF to PC Host software, so it can take some action like take a photo. I have tried to CyU3PUsbSendEP0Data() function to send the code, but it always returns error code 69 (CY_U3P_ERROR_TIMEOUT). So how can I realized the function.

   

Thank you very much.

   

Leon.

0 Likes
4 Replies
Anonymous
Not applicable

Hi,

   

CyU3PUsbSendEP0Data() can be called only when the data is requested by the PC. The FX3 cannot send it anytime it wishes,

   

So the actual sequence should be

   

(i)Button Press

   

(ii) Interrupt Function should set a flag that a button has been pressed.

   

(iii) PC should request data via Control Request

   

(iv) FX3 received the control request and checks if the Button has been pressed or not using the flag. If it is pressed, it sends the code to the PC using CyU3PUsbSendEP0Data API

   

Regards,

   

-Madhu Sudhan

0 Likes
Anonymous
Not applicable

Hi,Madhu,

   

Thank you for your reply.

   

If I want to send code to PC anytime it wishes, how can I realize it?

   

Best Regards,

   

Leon

0 Likes

Hi Madhu,

in this way, the pc should read data repeatedly, say every 500ms.

But when pc read the data(thru function CyU3PUsbSendEP0Data), there is a big chance that will cause DMA reset

here is the uart message

DMAReset Event: Commit buffer failure

Application stopped

Application started

the preview  on PC side is not stable and the frame rate drops.

0 Likes
Anonymous
Not applicable

This method maybe help you.

   

1. enable hardware trigger event(general event, not still image trigger event) 

   

2. send this hardware event to HSOT

   

3. HOST send one vendor cmd to FX3/CX3

   

4. FX3/CX3 return GPIO information to HOST(PC) 

0 Likes