UVC+CDC with commands FX3

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

cross mob
lock attach
Attachments are accessible only for community members.
LBence91
Level 4
Level 4
10 questions asked 50 sign-ins 25 replies posted

 

Hello,

I have custom PCB board which contains a FX3 mcu. I already have a working UVC firmware(the UVC part of the firmware is based on the AN75779 and uvc example project. ) where the debug module used for debug informations. The device is configured as a composite device (UVC and CDC). Now I want to send custom commands via the COM port. I modified the firmware based on the "John Hyde Design by example" book and example code (CDC_BulkLoop). But my problem is that I am not able to send commands via the COM port. For the serial communication I am using realTerm and TeraTerm. When I implemented the function which I  learnt from the "CDC_BulkLoop" example, but when I try to send commands the board not responding. Now I am a bit confused how to use the CDC device. I also checked the "cyfxusbuart" example, but it did not help understand the mechanics. I attached the source files that I modified in the UVC example project, and  image which shows the CDC descriptors of the device.

LBence91_0-1669205587648.png

Best Regards,

Bence

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Edited to attach the right attachment

Hi Bence,

Please find attached a zip folder of your firmware where sending commands on the CDC interface is working fine.

The issues with the firmware you had sent were:

1. Endpoint numbers were overlapping with two endpoints. Make sure every endpoint number is unique. 

2. Endpoint number in the descriptor does not match with the endpoint socket number for the DMA channels.

3. Single Socket was used for multiple purposes (DMA channel creation, debugInit etc). Use one socket/endpoint for a single purpose.

Please refer to the attached firmware where changes have been implemented.

Best Regards,
AliAsgar

View solution in original post

0 Likes
5 Replies
lock attach
Attachments are accessible only for community members.
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Edited to attach the right attachment

Hi Bence,

Please find attached a zip folder of your firmware where sending commands on the CDC interface is working fine.

The issues with the firmware you had sent were:

1. Endpoint numbers were overlapping with two endpoints. Make sure every endpoint number is unique. 

2. Endpoint number in the descriptor does not match with the endpoint socket number for the DMA channels.

3. Single Socket was used for multiple purposes (DMA channel creation, debugInit etc). Use one socket/endpoint for a single purpose.

Please refer to the attached firmware where changes have been implemented.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hi AliAsgar,

First of all thank you for your response. Maybe I misunderstood something but the project you attached is the same version which I attached. I compared with git and notepad++ the two attachments (Can you attach a modified version or mention the problematic functions?). Also your advices are very useful I already started to investigate the socket problem. I found some error and redeclaration. Now I am storing the endpoints in variables to avoid overlapping(bulk video = 0x83, video control interrupt = 0x82,CDCInterrupt = 0x81, CDCProducer = 0x05, CDCConsumer = 0x85, DebugProducer 0x04, Debugconsumer = 0x84). In the CyFxUVCApplnInit function I rewrote the endpoint and dma configuration. But after programming the board I got the same results. Still no response for the sent commands.

Best Regards,

Bence

0 Likes
lock attach
Attachments are accessible only for community members.
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Bence, 

Apologies for attaching the wrong folder. Please find the right folder attached to this post.

Best Regards,
AliAsgar

0 Likes

Hi AliAsgar,

Thank you for your help. I tested the implementation. I see you disabled the CyFxUVCApplnDebugInit function, so now I am not able to use the CyU3PDebugPrint function even if uncomment the debuginit function. Not really sure what is under the hood, but now the application only echoing my messages but not using the command parser callback or the debugprint functions. Is there a way to keep the debug prints and also the command reading endpoints? Thank you very much.

Best Regarsd,

Bence

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Bence,

Yes there is a way to keep the debugPrint working, but for that you would need a different USB endpoint and socket, not the ones used right now. The descriptors have to be changed accordingly.

Even UART lines can be used for debugPrints, if UART can be enabled for debug in your application.

Best Regards,
AliAsgar

0 Likes