USBFS example project DMA Auto Mode

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

cross mob
Anonymous
Not applicable

This example project can be used to calculate the maximum throughput using the Streamer Application.

   

It also details as comments, the use and significance of every function in the firmware. So one can use it to build and understand the concepts of USB APIs. 

   

The C# and C++ based applications are also archieved and attached.

   

It can be used to test and check the throughput.

   
        
   
    Cheers.!!   
0 Likes
20 Replies
Anonymous
Not applicable
        Very interesting test-bench but   
Regrettable to say, Attach was not success.   
Please use IE, FireFox or Safari.   
Anyway, I got 860KB/s by my board.   
0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Some people are having trouble using Chrome for posts.

   

 

   

Regards, Dana.

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

Ya, You are right. I was using Chrome.
Here is the attachment.

   

If the applications are not working, use the Cypress SuiteUSB  installed applications.

   

Cheers.!!

0 Likes
Anonymous
Not applicable

Hi!

   

Im trying to run the program but i always get problem installing the driver (which need to be installed automatically).

   

Im getting in Computer Management under "Other devices"->"Auto Mode" device which says:

   

"The drivers for this device are not installed. (Code 28)

There is no driver selected for the device information set or element.


To find a driver for this device, click Update Driver."

   

 

   

How can i solve it and run it?

   

 

   

Thank you.

0 Likes
Anonymous
Not applicable
        You need driver information file (*.inf) for your USB device   
I was looking the zip file but not find it   
What is your USB project?   
If USB-UART design then INF file would made automatically.   
If real USB-FS design, e,g Bulk transfer   
so, you have to made INF file by yourself.   
0 Likes
Anonymous
Not applicable

I was trying to run your project USB-FS no UART..

   

1. How do i make my own .inf file?

   

2. If i want to use 1024bytes per transfer, how do i configure my Endpoint Transer Type? as BULK limit to 64Bytes..

   

 

   

Thank you 🙂

0 Likes
Anonymous
Not applicable
        At first, Download this USB suits   
[ http://www.cypress.com/?rID=34870 ]   
There are Driver set and origin INF file   
You would be better modify it.   
How to make it, that was written in some PDF about CyUSB.dll in this suits.   
   
How to do large packet transfer more than 64byte,   
That is use sof flag (start of frame) and repeat use of Bulk end point.   
OK?   
0 Likes
Anonymous
Not applicable

Ok, and creating a driver will map the USBFS as COM port?

   

One more thing, I tried to run this example with USBUART component with DMA Automatic Memory Management

   

and two EP's with Max Packet size of 64Bytes, Transfer Type: BULK, and Interval 10ms (default).

   

And when the for loop is running endlessly, i do see the output on the pc terminal,

   

but when i try to run the DMA transaction only once, i do not see any output on the pc terminal.

   

My code is exactly like the example code with a minor change that i limit the output command: USBUART_1_LoadInEP(IN_EP,NULL,MAX_BUF);

   

to run only once and not as long as:

   

USBUART_1_GetEPState(IN_EP)== USBUART_1_IN_BUFFER_EMPTY

   

 

   

Thank you for your help.

0 Likes
Anonymous
Not applicable
        You say that is inconsistent   
To mapping the USBFS to COM port that is USBUART itself   
You owe to use USBUART   
   
Advantage of bulk transfer is ...   
User no needs select the COM port so user program can connect the USB automatically.   
And bulk transfer can use 6 another end point and can use it for various features   
Nonetheless, of cause, total physical tranfer rate is same as USBUART.   
   
And, What is this? NULL?   
USBUART_1_LoadInEP(IN_EP,NULL,MAX_BUF);   
You would doing transfer from NULL pointer   
No data should transfered.   
0 Likes
Anonymous
Not applicable

Thank you PSoC73 but i think i need to explain myself better...

   

The NULL called after the first intialization occured and the IN_EP is linked to the buffer:

   

USBUART_1_LoadInEP(IN_EP,&BufferIn[0],MAX_BUF);

   

then, the   USBUART_1_LoadInEP(IN_EP,NULL,MAX_BUF); is called in order to send the data to the pc through the DMA

   

and its happening only when this line called forever and NOT when it called once.

   

 

   

My Code look like this:

   

uint8 eflag = 0;

   

for(;;)
{
        if(USBUART_1_IsConfigurationChanged())
        {
            USBUART_1_LoadInEP(IN_EP,&BufferIn[0],MAX_BUF);
            USBUART_1_ReadOutEP(OUT_EP,&BufferOut[0],MAX_BUF);
            USBUART_1_EnableOutEP(OUT_EP);
        }
       
        /* PSOC to PC */
        if(USBUART_1_GetEPState(IN_EP)==USBUART_1_IN_BUFFER_EMPTY)
        {    /* An IN transaction occurred and more data can be loaded */
           
        }else if (USBUART_1_GetEPState(IN_EP)== USBUART_1_IN_BUFFER_FULL)
        {    /* The IN endpoint is loaded and the mode is set to ACK IN */

   


        }
       
        /* PC to PSOC */
        if(USBUART_1_GetEPState(OUT_EP)== USBUART_1_OUT_BUFFER_EMPTY)
        {    /* The OUT endpoint is set to ACK OUT and is waiting for data */

        }else if ( (USBUART_1_GetEPState(OUT_EP)==USBUART_1_OUT_BUFFER_FULL) && (eflag < 1))
        {    /* An OUT transaction has occurred and data can be read */
            USBUART_1_LoadInEP(IN_EP,NULL,MAX_BUF);
            eflag++;
        }

   

}

   

 

   

Thank you again...

0 Likes
Anonymous
Not applicable
        I see,   
When DMA transfer that use NULL pointer sending after first packet.   
I should know that, this time   
Anyway, Are you forget turn on the DMA loop flag?   
0 Likes
Anonymous
Not applicable

 Hey PSoC73,

   

I wasnt aware about this DMA Loop Flag, does it meen that if it turned on, each call to USBUART_1_LoadInEP(IN_EP,NULL,MAX_BUF); function will force the DMA to send the data to the host?

   

and how do i turn this flag on anyways?

   

 

   

Thank you so much!

0 Likes
Anonymous
Not applicable
        Yes, While loop flag is ON, DMA will continue repeat transfer to the USB,   
To turn on is once in configulation of DMA,   
For example DMA wizard do it.   
I think so, however i didn't do this DMA-USB model actually.   
Thank you.   
0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

I finally managed to install the usb driver (using the "CyUSBSerial_driver_v3.13.0.20_WHQL_CERTIFIED" driver from cypress) but when i run the C# and C++ applications i dont see any of the ENDPOINTS in the list.

   

Device manager screenshot is attached.

   

 

   

Thank you for your help!

0 Likes
Anonymous
Not applicable

 Hi team,

   

I am new to PSoC world and recently was working on a project to  enable USBFS in DMA mode.

   

I would greatly appreciate if anyone could point me to source of this example project. It looks like this project may resolve many of my issues. One of which is that I set up the buffer size on PSoC endpoints as 64 bytes but PC software (C# or Python alike) does not allow declaring  buffers longer than 8 bytes.

   

Thank you

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

The project was posted earlier as a compound zip file -

   

 

   

    

   

          http://www.cypress.com/?docID=45794

   

 

   

Regards, Dana.

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Another link in this thread -

   

 

   

    

   

          http://www.cypress.com/?docID=45783

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

 Thank you, Dana, for a quick reply. I appreciate this.

   

I was able to compile and deploy the PSoC part.

   

Still the C# application does not recognize endpoints and does not connect to the PSoC probably because my board has different Vendor_ID/Product ID.

   

I did not find source code in the zipped archives so that I could recompile the application. Is the source available by any chance?

   

Thank you

   

Mikhail

0 Likes
Anonymous
Not applicable

Hi Dana,

   

I found one source of a host application - AN70983 - Designing a Bulk Transfer Host Application for EZ-USB

   

It compiles but fails when connecting to the PSoC device. Can you give me a hint what may be causing such a failure.

   

The line myDevice = usbDevices[VID, PID] as CyUSBDevice; returns a NULL.

   

I have changed the VID and PID in the Form1.cs code to my PSoC values but during debugging I still see the old values, like, 04b4 etc. Where are those stored?

   

Thank you

   

Mikhail

0 Likes
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

 Hi,

   

 

   

You can see the source code for the applications in the location C:\Cypress\EZ-USB FX3 SDK\1.2\application\c_sharp if you have installed the USB Suite (http://www.cypress.com/?rID=34870).

   

Can you please try to run your application with only change in PID and keeping the VID as 04b4 itself in the PSoC Creator project as well as in the host application. Please check if this is working.

   

 

   

Thanks,

   

Hima

0 Likes