13 Replies Latest reply on Nov 12, 2019 2:31 AM by PrM_1403381

    How to test USBotg or USBHost in Cypress FX3

    PrM_1403381

      Hi,

       

      I am using Cypress FX3 (CYUSB3KIT-003) From the Cypress FX3 Data sheet, It will support USB 2.0 Host mode and as well peripheral mode.

      So I Imported USBHost example source into my work space,

       

      From the application note AN77960, It looks DVK kit used for this testing is CYUSB3KIT-001

      https://www.cypress.com/documentation/development-kitsboards/ez-usb-fx3-development-kit-cyusb3kit-001

       

      So, Is it possible to use the same source file to test USBOtg/USBHost CYUSB3KIT-003 DVK kit,

       

      If Yes, Can you please provide any application note is available for testing.

       

      Thanks & Regards

      Prasanna

        • 1. Re: How to test USBotg or USBHost in Cypress FX3
          RashiV_61

          Hello Prasanna,

           

          For configuring FX3 as USB 2.0 Host controller, CYUSB3CYUSB3KIT-001 DVK was used in the self powered mode.

          The FX3 explorer kit CYUSB3KIT-003  board operates only in USB bus-powered mode, so you cannot use the USBHost example on it.

           

          Regards,

          Rashi

          • 2. Re: How to test USBotg or USBHost in Cypress FX3
            PrM_1403381

            Hi Rashi,

             

            Thanks for your quick response,

             

            CYUSB3CYUSB3KIT-001 DVK is obsolete right ?

             

            So, If I want to emulate Cypress FX3 as a host is not possible with CYUSB3KIT-003 kit ?

             

            If I make setup to provide supply from external supply, instead of taking Vbus from USB "J1" connector in CYUSB3KIT-003, By removing U11,

            Then, Can I test USBHost example in CYUSB3KIT-003 kit ? Will this method will fulfill the requirement for testing the USbHost application ?

            FX3.JPG

            If you have any suggestion, please let me know.

             

            Thanks & Regards

            Prasanna

            • 3. Re: How to test USBotg or USBHost in Cypress FX3
              RashiV_61

              Hello Prasanna,

               

              Yes, CYUSB3CYUSB3KIT-001 DVK is obsolete.

               

              For the FX3 to work as host controller you would need to design a custom board. FX3 explorer kit doesn't use the E10 pin (Vbatt) which is for the powering up the FX3 through external source.(self power mode)

               

              The changes you mentioned in your previous response are not recommended.

               

              The readme.txt in the usbhost example quotes

                " Care should be taken so that an USB host is not connected to FX3 while

                 host stack is active. This will mean that both sides will be driving

                 the VBUS causing a hardware damage."

               

              Vbus is used for detection of device connection and you would be needing it while you work with the firmware. So it is not possible to test this firmware with superspeed explorer kit.

               

              Please let us know the application you need to check this example for. If you just need the observations, we can test it our end on the DVK board and share the results.

               

              For designing the custom board: Please refer to the Hardware guidelines AN70707

               

              Regards,

              Rashi

              • 4. Re: How to test USBotg or USBHost in Cypress FX3
                PrM_1403381

                Hi Rashi,

                 

                Please find my comments below.

                 

                For the FX3 to work as host controller you would need to design a custom board. FX3 explorer kit doesn't use the E10 pin (Vbatt) which is for the powering up the FX3 through external source.(self power mode)

                     --> If I connect external Supply input to E10(Vbatt) will FX3 work in Self power mode ?

                          FX3 needs power to work, That we need to provide either by VBUS_IN (Via USB) or VBATT ?

                 

                The changes you mentioned in your previous response are not recommended.

                     --> What is the effect ? If I provide supply by using the method (mentioned in my previous response).

                          As per my understating USB3_VBUS is the supply being used in the system for all the power rails, and is provided from the VBUS_IN (USB connector - J1), So I removed U11 and provided direct external supply to USB3_VBUS rail. So that FX3 will be operating without connecting to Host via USB. Correct me, If I am wrong ?

                 

                The readme.txt in the usbhost example quotes

                  " Care should be taken so that an USB host is not connected to FX3 while

                   host stack is active. This will mean that both sides will be driving

                   the VBUS causing a hardware damage."

                     --> Supply can be controlled right ? By using the mode of operation, When act as device and host ?

                     If yes, How it can be automated to handle in FW ?

                 

                Vbus is used for detection of device connection and you would be needing it while you work with the firmware. So it is not possible to test this firmware with superspeed explorer kit.

                 

                Please let us know the application you need to check this example for. If you just need the observations, we can test it our end on the DVK board and share the results.

                     --> I need to test FX3 in Host mode. (As it supports USB 3.1 peripheral and USB 2.0 Host right ?).

                     Can you help me to test "cyfxusbotg", Or suggest any other example that can be used to test Cypress FX3 as host and as well device.

                     Is there any possibility, that in run time can we change the FX3 modes as Device and Host ?

                 

                Thanks & Regards

                Prasanna

                • 5. Re: How to test USBotg or USBHost in Cypress FX3
                  RashiV_61

                  Hello Prasanna,

                   

                  - Vbatt need to be connected to the external power source if FX3 is to be used in self powered mode.

                  - FX3 can work in two ways : 1) Bus powered mode (will draw the power from VBus 2) Self Power mode (will draw power from the VBatt)

                  You can refer to the FX3 datasheet as well as the Hardware guidelines AN70707 for the same.

                  - VBus is used for the power supply rail as well as the detection whether connected to Host or not. If you provide power supply through VBus and load the firmware (usbhost). It will initialize the host stack and drive the VBus which can cause damage.

                  - How would you control the supply? You mean switching between the external source and VBus from the connector? It won't help as you would need to reboot the firmware as there wouldn't be power while switching

                  - In cyfxusbotg example, FX3 can work as both device and host in run time. A callback event occurs (which switches between host and device) when it finds there is change in type of connector to the usb receptacle.

                   

                  Regards,

                  Rashi

                  • 6. Re: How to test USBotg or USBHost in Cypress FX3
                    PrM_1403381

                    Hi Rashi,

                     

                    Thanks for your quick response and information.

                     

                    So, with custom modified Cypress FX3 board I can test cyfxusbotg  example ?

                     

                    In FX3 DVK, If I provide external supply to VBATT, and keeping the U11 same, Then I can test cyfxusbotg example right ?

                    But it looks VBATT is not brought out in Cypress FX3 DVK , Can you help me out ?

                     

                    If Yes, I will try this method and get back to you.

                     

                    In this case how supply will be provided by FX3 (host mode) to the device. Still is there a possibility that I will face a situation that both will drive the Vbus when connected to host ? can you suggest any mechanism to automate or this mechanism is exist in FX3 DVK itself ?

                     

                    - In cyfxusbotg example, FX3 can work as both device and host in run time. A callback event occurs (which switches between host and device) when it finds there is change in type of connector to the usb receptacle

                         --> Is this works on CYUSBKIT-003 ?

                     

                    If I need to make a custom board FX3 using CYUSB3014 IC to support both Host and Device mode what changes need to be done ?

                    How FX3 will detect that connected DUT is Device or Host ?

                     

                    Thanks & Regards,

                    Prasanna

                    • 7. Re: How to test USBotg or USBHost in Cypress FX3
                      RashiV_61

                      Hello Prasanna,

                       

                      From the custom board, i meant to designing of your own custom board using FX3.

                       

                      In FX3 DVK, If I provide external supply to VBATT, and keeping the U11 same, Then I can test cyfxusbotg example right ?

                      If Yes, I will try this method and get back to you

                      >> Do you have FX3 DVK board (CYUSB3KIT-001)?

                       

                      If you meant the Superspeed explorer kit (CYUSB3KIT-003), you cannot use explorer kit for testing this application

                       

                      VBatt is for powering up the USB I/O (refer to section 4 power modes in AN70707). Other parts of the FX3 will also need the power (core, other GPIO's). Please refer to the FX3 DVK (CYUSB3KIT-001) schematics for better understanding https://www.cypress.com/documentation/development-kitsboards/ez-usb-fx3-development-kit-cyusb3kit-001

                       

                      - The situation that you pointed to will be taken care by the usbotg example. Please refer to the CyFxOtgVbusChangeHandler function which enables the host stack only after stopping the device mode (peripheral mode).

                       

                      - Are you doing this only for testing purpose or there is some other application you are working on? Please let us know to help you better.

                       

                      Regards,

                      Rashi

                      • 8. Re: How to test USBotg or USBHost in Cypress FX3
                        PrM_1403381

                        Hi Rashi,

                         

                        I don't have CYUSB3KIT-001, As I mentioned in my first comment I want test this application in CYUSB3KIT-003, Is that possible by making any changes to the CYUSB3KIT-003 ?

                         

                        - Are you doing this only for testing purpose or there is some other application you are working on? Please let us know to help you better.

                             --> My requirement is I should be able to run the loop back application to check the speed of the Host device connected

                                       (With existing loop back application it is working)

                             --> FX3 need to emulate as embedded Host.

                         

                        EZ-USB FX3 Technical Reference Manual, Document Number: 001-76074 Rev. *F, This TRM is holds good for CYUSB3KIT-003 right ?

                        If Yes, In the features supported by FX3 are :

                        The FX3 USB subsystem supports the following modes of operation:

                        ■ USB 3.0 peripheral in Super Speed (5 Gbps)

                        ■ USB 2.0 peripheral in High/Full Speed (480/12 Mbps, respectively)

                        ■ USB 2.0 host in High/Full/Low Speed (480/12/1.5 Mbps respectively), with one downstream port; the hub is not supported

                        ■ USB 2.0 OTG dual-role device (DRD), with Host Negotiation Protocol (HNP) and Session Request Protocol (SRP)

                        support.

                         

                        So how host mode can be tested on CYUSB3KIT-003 ? What are the changes need to be done ?

                         

                        Do you suggest any other cypress chip that supports both peripheral and host mode, and the DVK can be used for verifying above mentioned features in TRM ?

                         

                        Thanks & Regards,

                        Prasanna

                        • 9. Re: How to test USBotg or USBHost in Cypress FX3
                          RashiV_61

                          Hello Prasanna,

                           

                          The Superspeed explorer kit (CYUSB3KIT-003) cannot support the usbotg/usbhost examples.

                           

                          The TRM is for the FX3 chip and not for the Superspeed explorer board.All the points you mentioned are for FX3 (CYUSB301x).

                           

                          You can  develop  hardware circuitry (board) with FX3 (refer to the FX3 DVK board (CYUSB3KIT-001) schematics )

                           

                          USBHost and USBOTG examples cannot be tested on CYUSB3KIT-003 (circuits doesn't support driving of VBus)

                           

                          Regards,

                          Rashi

                          • 10. Re: How to test USBotg or USBHost in Cypress FX3
                            PrM_1403381

                            Hi Rashi,

                             

                            Thanks for your inputs.

                             

                            I will go through FX3 DVK board (CYUSB3KIT-001) schematics.

                             

                            USBHost and USBOTG examples cannot be tested on CYUSB3KIT-003 (circuits doesn't support driving of VBus)

                                 --> Your concern is about driving Vbus from CYUSB3KIT-003, while acting as host right ?

                                      I will add one fixture and provide Vbus manually to the device externally. and provide power supply explicitly to FX3 IC by removing U11 and connecting Supply to FX3           Chip. So by doing this exercise will I be able to test cyfxusbotg example.  Or you have any library related concerns, etc., other than lack of Vbus driving capability from the CYUSB3KIT-003 in host mode.

                             

                            I will get back to you.

                             

                            Thanks & Regards

                            Prasanna

                            • 11. Re: How to test USBotg or USBHost in Cypress FX3
                              PrM_1403381

                              Hi Rashi,

                               

                              I made some setup with Cypress FX3(CYUSB3KIT-003) Kit, and tested USBBulkLoopOtg example. Below are the 2 methods that i followed. Please let me your comment.

                               

                              Setup 1 : As shown in Below Image J1 I connected directly connected to Host-PC and J8 connected to Host-PC(For Debug Prints)

                              Skype_Picture_2019_11_08T11_18_42_527Z.jpeg

                              The Debug print Outputs are as below.

                              Terminal_Log1.jpg

                               

                              Setup 2 : From external source I provided Vbus to Cypress FX3, By connecting 5V from external power supply to the VBUS pin on J6 connector, and to the J1 connector I used Type-A to Female to Type B Male adapter and I connected Mouse as shown in Below image. And I have attached Terminal log also.

                              Skype_Picture_2019_11_08T11_18_50_769Z.jpeg

                              Below is the Print log still it initialized Device stack.

                              Terminal_Log2.jpg

                               

                              You have any suggestions for me test the host mode in Cypress FX3(CYUSB3KIT-003) kit. Let me know if anything I am missing.

                               

                              Thanks & Regards

                              Prasanna

                              • 12. Re: How to test USBotg or USBHost in Cypress FX3
                                RashiV_61

                                Hello Prasannakumar,

                                 

                                As per the debug logs, the event callback is due the peripheral change.

                                As per the application firmware, host stack will be enabled when the peripheral detected  is CY_U3P_OTG_TYPE_ACA_A_CHG and before switching from device to host VBUS is disabled using CyFxUsbVBusControl (CyFalse). But in your case VBUS cannot be disabled as you are supplying it externally.

                                 

                                Also, OTG type (device or host)  is detected using OTG_ID pin, which is not used in the Superspeed explorer Kit (CYUSB3KIT-003). In my previous post, i had mentioned  usbotg and usbhost examples cannot be tested using Superspeed explorer kit.

                                 

                                Regards,

                                Rashi

                                • 13. Re: How to test USBotg or USBHost in Cypress FX3
                                  PrM_1403381

                                  Hi Rashi,

                                   

                                  Yes I agree, We can't test usbotg and usbhost examples with (CYUSB3KIT-003) as per your previous post. And you mentioned we need to make a custom board with (CYUSB3KIT-001) as a reference.

                                   

                                  But at present I have only (CYUSB3KIT-003) kit with me. So before going with custom board making, I need to verify basic POC using (CYUSB3KIT-003) kit. So I tried above mentioned methods.

                                   

                                  You have any suggestions with existing (CYUSB3KIT-003) DVK is there any possibility that I can verify Host mode by setting as default to host for my POC. Since CYUSB3KIT-001 kit is obselete now. how host mode can be tested ?

                                   

                                  Thanks & Regards

                                  Prasanna