Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Confusion about flags and threads

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Confusion about flags and threads
Moderator:
RSKV

Post Reply
Follow this topic



Confusion about flags and threads

Chris R. posted on 26 Aug 2011 2:10 AM PST
Top Contributor
135 Forum Posts

I am al litte confused regardig the flags and their connection to the threads of the FX3. In the slave FIFO example the FLAG B is a copy of FLAG A and the flag is connected to the current thread. Its not clear to me if there are two threads (one for P to U and one for U to P) or only one thread (the software thread SlFifoAppThread_Entry).

Is it possible to use the FIFO flags like the FX2 controller? I want to use one flag fixed to the OUT endpoint (as empty flag) and one flag fixed to the IN endpoint (as full flag)? In the firmware example I cannot find the connection between the dma channels and the threads (0 to 3). Can you explain it to me? Thanks a lot.

Christian




Re: Confusion about flags and threads

aasi posted on 26 Aug 2011 05:24 AM PST
Cypress Employee
1073 Forum Posts

Hi Chris,


Please look at the slave FIFO app note. It has a section where it clearly explains the FLAG configurations possible. This should help you understand the thread and possible FLAG configurations.


Regards,


Anand



Re: Confusion about flags and threads

Chris R. posted on 26 Aug 2011 05:39 AM PST
Top Contributor
135 Forum Posts

Thanks for your answer. I´ve read the Application note, but this one is not really clear to me: "The sockets that are to be used
must be mapped to a thread. This mapping is done by EZUSB FX3 firmware".
I did not found the mapping of sockets to four possible threads in the example firmware. Maybe I dont understand this correctly...
The flags configuraion is clear, but not the mapping between the FIFOs and threads....



Re: Confusion about flags and threads

Chris R. posted on 29 Aug 2011 08:43 AM PST
Top Contributor
135 Forum Posts

No further tips for me? What are the A1:A0 adresses of the current_thread using in the slave fifo example firmware? In the firmware I can find this mapping:

/* Used on FX3 silicon. */
#define CY_FX_EP_PRODUCER_PPORT_SOCKET    CY_U3P_PIB_SOCKET_0    /* P-port Socket 0 is producer */
#define CY_FX_EP_CONSUMER_PPORT_SOCKET    CY_U3P_PIB_SOCKET_3    /* P-port Socket 3 is consumer */

But I think this is for the DMA controller only? Where can I find the socket to thread mapping?



Re: Confusion about flags and threads

Chris R. posted on 31 Aug 2011 06:46 AM PST
Top Contributor
135 Forum Posts

After crawling a night long in the header files with hundreds of registers I think I found the solution: The 4 registers CY_U3P_PIB_GPIF_THREAD_CONFIG_ADDRESS map one of the 32 PIB sockets to the 4 physical threads of the GPIF. This is coded in the 5 least significant bits. So the SyncSlaveFIFO firmware example uses thread 0 and 3, as the 4 threads are mapped to the PIB sockets 0 to 3.

Is this right? I thik this mapping is not completely explained in the slave fifo appnote.



Re: Confusion about flags and threads

raj8889 posted on 22 Nov 2012 04:59 AM PST
Senior Member
19 Forum Posts

0 and 3 are the (address pins or sockets) and 0 pin is to send data in to the usb to pc and when u are connected to the socket 3 u can read data out from the usb. so far I could understand this but later can I connect an other socket (consumer)out from the same thread ???

Or should I create an other thread for it



Re: Confusion about flags and threads

RSKV posted on 23 Nov 2012 10:17 PM PST
Cypress Employee
655 Forum Posts

Hi Chris,

You are right.

The word “thread” refers to a hardware thread (FX3 terminology), not a software thread.
Let me explain a little bit more on the term “thread” in case of FX3.

Basically we have 32 sockets on the GPIF port of FX3. Socket will be having some buffer attached to it and each socket (numbered 0, 1 ,2 ,3) are mapped to the thread 0, 1, 2, and 3.

Thanks,

sai krishna.

 



Re: Confusion about flags and threads

raj8889 posted on 23 Nov 2012 01:31 AM PST
Senior Member
19 Forum Posts

Hello Sai Krishna,

I have 3 questions

1 .SO you mean to say that the address signals are meant to address the threads but not the sockets and the sockets are configured using dma channel configuration is it right??

2. What about the remaining other sockets other than (0,1,2,3) are all sockets connected to the 4 threads ??

3. This is regarding the Flags. Do the flags provide the status of the endpoint buffers??

Please clear these points

 

regards,

Pruthvi Raj 



Re: Confusion about flags and threads

RSKV posted on 03 Dec 2012 11:09 PM PST
Cypress Employee
655 Forum Posts

Hi Raj,

Please find answers to your questions below:

1 .SO you mean to say that the address signals are meant to address the threads but not the sockets and the sockets are configured using dma channel configuration is it right??

Actually address lines addresses the sockets not treads. Sockets are mapped to threads. Socket 0 is mapped to thread 0.

Socket 1 is mapped to thread 1

Socket 2 is mapped to thread 2

Socket 3 is mapped to thread 3. This is a default mapping. Again if you want to access socket 4 then it is mapped to thread 0. socket 5 is to thread 1 and so on.

For more details on 2bit addressing (to address first 4 sockets) and 5bit addressing (to access all 32 sockets), please refer to the following application notes:

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

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

2. What about the remaining other sockets other than (0,1,2,3) are all sockets connected to the 4 threads ??

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

This talks about addressing all 32 sockets

3. This is regarding the Flags. Do the flags provide the status of the endpoint buffers??

when you create a DMA channel between USB endpoint and a P-port side (GPIF II) socket then flags indicate the status of the buffer allocated for the DMA channel based on which side is producer and consumer.

 

Thanks,

sai krishna.

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.