FX3s Manual DMA Channels

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

cross mob
dgrierms
Level 1
Level 1
First reply posted First question asked Welcome!

Hello,

for our application we would like to use USB virtual com port to send/receive status messages with FX3s. My understanding is that I will need a MANUAL_IN DMA channel to transfer messages to the FX3 CPU and a MANUAL_OUT buffer to send messages to the host PC. I have modified the USBUart example project, but have encountered a lot of errors.

  1. When using a MANUAL_IN channel it appears the producer fills up our buffers and then quits producing events. We aren't sure how to consume the data in the buffers that producer events keep firing.
  2. When using a MANUAL_OUT channel, the overall application is broken and the host can no longer connect to the serial port. The USB setup completes as our host PC can see the COM port, but is unable to connect.

Can someone please help us understand the steps needed to produce/consume data with manual DMA channels?

 

 

0 Likes
1 Solution

Hello,

Based on my understanding, you would like to add a CDC interface for sending the debug messages to the host. For this, you can make use of the API CyU3PDebugInit () with the desired endpoint socket number. This API will initialize the firmware logging functionality. The API will internally create a MANUAL OUT DMA channel for sending the debug messages. Please refer to FX3 API Guide to understand how to use this API. This API should be used after the initialization of the endpoint through which the logs will be received by the host. Once this API is used to initialize the firmware logging, the prints can be obtained by using the API CyU3PDebugPrint(). A similar solution was given to a customer who was making use of CX3 (CYUSB3064). Please refer to the following link which has an example project for CX3 (CYUSB3064):

https://community.infineon.com/t5/USB-Superspeed-Peripherals/Add-CDC-device-to-CX3/td-p/275828

You can port the necessary code from the project shared in the above thread to develop your application. Please let me know if you face any difficulties while implementing this.

I could not properly understand the issue with the following requirement:

"Host could send simple command, such as toggle LED or instruct CPU to perform some other action."

Inside the code, I found that you have written a DMA callback function (MyDmaCallback) for the MANUAL_IN channel. Can you please elaborate what is the issue seen here so that we can debug this part as well.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
3 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please let me know if you are using FX3 (CYUSB301x) or FX3S (CYUSB303x) for your application.  Also, please elaborate your application so that we can suggest the best possible solution for you.

I understand that you are using MANUAL_IN channel to send data from a producer socket to CPU. What is done with this data? Do you want to send this data to another socket with CPU intervention? If this is the use case, then please use MANUAL channel instead of MANUAL_IN channel.

I did not properly understand your query on MANUAL_OUT channel. Based on your description, I have a feeling that some of the APIs may be failing in the initialization phase which might be causing the error handler loop to run infinitely. Please share the  complete source code of the application, UART debug logs and also elaborate the issue so that I can understand it better. 

Best Regards,
Jayakrishna
0 Likes
lock attach
Attachments are accessible only for community members.
dgrierms
Level 1
Level 1
First reply posted First question asked Welcome!

We are using the CYUSB3035. UART is not available for debug message in our application so we are looking for a way to send debug messages to the host via virtual com port (VCP) since it is natively supported by the host OS and easy to automate interactions with scripting languages such as python.

The workflow we are looking for is:

  1. CPU could send debug message, for example, capacity of SD Card
  2. Host could send simple command, such as toggle LED or instruct CPU to perform some other action.

If there is a better way to implement this than VCP then I am open to that, but we are not interested in writing any host-side drivers. We chose VCP as it is simple and natively supported by man operating systems.

I have attached a zip archive of the code we have been experimenting with. Thank you for your assistance on this.

 

-Davis

0 Likes

Hello,

Based on my understanding, you would like to add a CDC interface for sending the debug messages to the host. For this, you can make use of the API CyU3PDebugInit () with the desired endpoint socket number. This API will initialize the firmware logging functionality. The API will internally create a MANUAL OUT DMA channel for sending the debug messages. Please refer to FX3 API Guide to understand how to use this API. This API should be used after the initialization of the endpoint through which the logs will be received by the host. Once this API is used to initialize the firmware logging, the prints can be obtained by using the API CyU3PDebugPrint(). A similar solution was given to a customer who was making use of CX3 (CYUSB3064). Please refer to the following link which has an example project for CX3 (CYUSB3064):

https://community.infineon.com/t5/USB-Superspeed-Peripherals/Add-CDC-device-to-CX3/td-p/275828

You can port the necessary code from the project shared in the above thread to develop your application. Please let me know if you face any difficulties while implementing this.

I could not properly understand the issue with the following requirement:

"Host could send simple command, such as toggle LED or instruct CPU to perform some other action."

Inside the code, I found that you have written a DMA callback function (MyDmaCallback) for the MANUAL_IN channel. Can you please elaborate what is the issue seen here so that we can debug this part as well.

Best Regards,
Jayakrishna
0 Likes