You are here

USBFS example project DMA Auto Mode | Cypress Semiconductor

USBFS example project DMA Auto Mode

Summary: 20 Replies, Latest post by HIMA on 04 Nov 2014 03:37 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
TheThinker's picture
User
37 posts

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.!!
user_119377051's picture
User
866 posts

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.

user_14586677's picture
User
7648 posts

Some people are having trouble using Chrome for posts.

 

Regards, Dana.

TheThinker's picture
User
37 posts

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.!!

Naftul's picture
User
13 posts

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.

user_119377051's picture
User
866 posts

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.

Naftul's picture
User
13 posts

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 :)

user_119377051's picture
User
866 posts

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?

Naftul's picture
User
13 posts

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.

user_119377051's picture
User
866 posts

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.

Naftul's picture
User
13 posts

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...

 

Log in to post new comments.