7 Replies Latest reply on Mar 14, 2013 12:55 AM by nikhil.naik

    Programming USBHost Application Example

    sajeevan.k

      Dear Sir/Madam,

      In the USBHost Application Example, at the beginning of cyfxusbhost.c , it is mentioned that "Care should be taken so that, a USB host is not connected to FX3 while while host stack is active. This will mean that both sides driving the VBUS causing a hardware damage."

      Can we program the USBHost Application example .img file into the RAM of FX3 using the tool "Control Center" with the help of the USB3.0 cable provided. While we are doing so, after the programming is completed, the USBHost software is running in the FX3, while the a USB Host is connected to the FX3 through USB3.0 cable. Would the hardware be damaged under such a condition.

      Expecting Your valuable reply, as soon as possible, before the start of testing.


      regards,
      Sajeevan.K

         
          

      No Attachments Found

         
         
              
              /*--Begin: Char limitation:Shemi 10/10/2012--*/ function limitText(limitField, limitNum) { if (limitField.value.length > limitNum) { limitField.value = limitField.value.substring(0, limitNum); alert("Character limit exceeded--please reduce the length of description or use a file attachment."); } } /*--End: Char limitation:Shemi 10/10/2012 --*/   
        • 1. Re: Programming USBHost Application Example
          rama.sai.krishna.vakkantula

          Hi Sajeevan,

             

           

             

          Programming steps are clearly documented in the following application note. Please follow them:

             

          http://www.cypress.com/?rID=62942

             

           

             

          Actually, you will be connecting a USB device to the connector that is provided on the board. You can try programming the SPI flash present on the board with the host image file.

             

          Otherwise please follow as per the application note.

             

           

             

          Thanks,

             

          Sai Krishna.

          • 2. Re: Programming USBHost Application Example
            sajeevan.k

            Hi Sai Krishna,

               

             

               

            I have gone through this document.

               

            In this document how to compile (creating .img file ) is explained. Then running it with Zylin Debugger is explained.

               

            Programming either SPI Flash or RAM of FX3 board with a PC/Laptop using USB3.0 cable is not explained.

               

            That is why I am getting doubt.

               

            I think Zylin Debugger is connected through JTAG connector. ( not through USB connector ).

               

             

               

            Suppose we program the .img file of USBHost example Application into either SPI flash, I2C E2PROM or RAM with the help of the Tool "Control Center", from a PC/Laptop, by using a USB3.0 cable.

               

            Then after the .img is programmed into the FX3 board, the USBHost application example shall be running on the board. Immediately we cannot remove the  USB3.0 cable.

               

            So atleast for a few seconds of time, a Host PC shall be connected to the USB port of the FX3 board, while the USBHost Application is running.

               

            Would it cause a hardware damage?

               

            Or the Host software in the FX3 board, protect the hardware ? ( There are some switching OFF and switching ON of VBUS routines in the software )

               

             

               

            We don't have a Zylin Debugger or any other JTAG programmer. So at present, we have to program by using USB3.0 cable only.

               

             

               

            Any cheaper JTAG programmer ( we don't require debugging feature ) available for programming the FX3 board? 

               

             

               

              

               
               

            regards,

               

            Sajeevan.K

            • 3. Re: Programming USBHost Application Example
              nikhil.naik

               Sajeevan

                 

              I assume you are following the document which Sai Krishna pointed out.

                 

              The safest option is to load the code through JTAG. If you do not have JTAG adapter. You could try the following steps:

                 

              1) Connect the FX3 DVK in USB boot mode and load the USBHost firmware into SPI flash.(J101,102,103,104 need to connected for SPI)

                 

              2)Disconnect the FX3 kit from  PC. Change the PMODE setting to boot from SPI.

                 

              3) Make the jumper settings for Host mode (as shown in Figure 3 of the above mentioned document)

                 

              4)Connect a device to FX3 and power the board with an external supply. (Make sure VBatt J143 is connected to 5V). The FX3 will boot up from SPI and will now be in Host mode

                 

              5)Now change J101,102,103,104 to UART to get the debug messages.

                 

               

                 

              Thanks

                 

              Nikhil

              • 4. Re: Programming USBHost Application Example
                sajeevan.k

                Hi Nikhil,

                   

                 

                   

                As You Suggested, First I program the USBSlave.img(which is already working) file in SPI Flash, after setting J101-104 in 2-3 position. 

                   

                The I switched OFF the Power Supply.  After setting J101-104 in 1-2 position, and setting the jjumbers J96,J97,J98 and SW25 for boot from SPI flash,  I switched ON the Power Supply.  But the Application is not running.

                   

                But after setting J101-104 in 2-3 position with jumbers J96, J97,J98 and SW25 for boot from SPI flash, when I swicthed ON, the application is working fine.

                   

                Here what I am thinking is, for a program which is stored in SPI flash to run, J101-104 must be in 2-3 position. But then I shall not get RS232 messages.

                   

                If I can load the firmware (.img file) in I2C E2PROM, the problem would be solved. But when I attempt to program the I2C E2PROM, it is showing the message "Programming of EEPROM failed". (even after closing J42 and J45).

                   

                I had tried the same while devolopng slave mode also, but it was not working. But programming SPI flash is working fine.

                   

                I am using SMD 24LC256 IC, and it is connected to DIP with some wires.

                   

                 

                   

                Would You please suggest, what could be the reason for E2PROM programming failure. If that is corrected, my problem would be solved.

                   

                 

                   

                 

                   

                reagrds,

                   

                Sajeevan.K

                • 5. Re: Programming USBHost Application Example
                  rama.sai.krishna.vakkantula

                  Hi Sajeevan,

                     

                  Problem is with the EEPROM that you are using.

                     

                  24LC256 has just 256Kbits (which is nothing but 32KB) capacity. It is not sufficient to store the .img file of FX3.

                     

                  You may need to go for 24LC1024 which has 128KB capacity. (multiple if code size is more than 128KB).

                     

                  Thanks,

                     

                  sai krishna.

                  • 6. Re: Programming USBHost Application Example
                    sajeevan.k

                    Hi Sai Krishna,

                       

                     

                       

                    Thank You.

                       

                    We are purchasing Microchip 128kb, I2C EEPROM IC. 

                       

                     

                       

                    regards,

                       

                    Sajeevan.K

                    • 7. Re: Programming USBHost Application Example
                      nikhil.naik

                       Make sure you double-check the image size and have a little extra EEPROM space, to accommodate the changes you make to the code, if any.

                         

                       

                         

                      Thanks

                         

                      Nikhil