1 2 Previous Next 28 Replies Latest reply on Nov 11, 2018 8:25 PM by SrinathS_16

    fx2 can read 5039104 bytes

      Hello,I am using fx2 to read data from a image sensor with 2592*1944 bytes ,I  got data up to 4194304 bytes correctly and rest of the bytes were zeros. Is there any maximum limit for the receiving data in the Slave fifo mode or in the xferdata function.

       

      Best regards,

      Sandeep

        • 1. Re: fx2 can read 5039104 bytes
          SrinathS_16

          Hello Sandeep,

           

          - The XferData() API does not pad up any 0's at the end of the transfer. It either returns success or failure depending on the number of bytes that is being transferred. In case the XferData() API fails for a large amount of data transfer, increase the timeout value by specifying the TimeOut parameter of the corresponding endpoint.

          - Are you using Control Center to perform the data transfer. If not, please try using the same.

          - Is the image sensor configured properly? How are the FV and LV signals communicated to the FX2LP? Please share a part of the schematic containing the slave FIFO part of the FX2LP.

           

          Best regards,

          Srinath S

          • 2. Re: fx2 can read 5039104 bytes

            Hello srinath,

            I checked data in the control center application ,control center application data  and schematic are  attached herewith .

             

            Best regards,

            SandeepCyconsole_SS.JPGSchematic.JPG

            • 3. Re: fx2 can read 5039104 bytes
              SrinathS_16

              Hello Sandeep,

               

              - Please let me know what is the value driven on the PA1 pin.

              - Also, probe the SLWR# and FD[7:0] lines during the failure and check if there is any data transfer happening between the FX2LP and the image sensor.

               

              Best regards,

              Srinath S

              • 4. Re: fx2 can read 5039104 bytes

                Hello srinath,

                my TDpoll function Fx2 code is

                void TD_Poll( void )

                {

                    if(Single)

                  {

                        FIFOADR0=0;    //pA1 selecting  Ep6  

                       SYNCDELAY;

                       FIFORESET = 0x80;     // activate NAK-ALL to avoid race conditions

                      SYNCDELAY;

                     EP6FIFOCFG = 0x00;    //switching to manual mode

                     SYNCDELAY;

                     FIFORESET = 0x06;     // Reset FIFO 6

                     SYNCDELAY;

                     FIFORESET = 0x00;     //Release NAKALL

                     SYNCDELAY;

                     while(IOA & 0x01);     // wait until FV,PA0 Becomes low

                     while (!(IOA & 0x01)); // wait until FV,PA0 Becomes High

                     EP6FIFOBUF[0]=0xFF;    // 5bytes of Header used by the Preview Utility         to detect the Start of Transmission

                     EP6FIFOBUF[1]=0x00;

                     EP6FIFOBUF[2]=0x0F;

                     EP6FIFOBUF[3]=0x00;

                     EP6FIFOBUF[4]=0xFF;

                     EP6BCH=0x02;        //512 bytes committed

                     SYNCDELAY;

                     EP6BCL=0x00;

                     SYNCDELAY;

                     FIFORESET = 0x80;      // activate NAK-ALL to avoid race conditions

                     SYNCDELAY;

                     EP6FIFOCFG = 0x00;     // switching to manual mode

                     SYNCDELAY;

                     FIFORESET = 0x06;      // Reset FIFO 6

                     SYNCDELAY;

                     EP6FIFOCFG = 0x0C;     // switching to auto mode

                    SYNCDELAY;

                    FIFORESET = 0x00;      //  Release NAKALL

                    SYNCDELAY;

                    Single=FALSE; 

                }

                  }

                i checked LV,SLWR# in the CRO

                how to check the failure condition ?

                Best regards,

                Sandeep N C

                • 5. Re: fx2 can read 5039104 bytes
                  SrinathS_16

                  Hello Sandeep,

                   

                  Please probe the FD[7:0] pins along with FV and LV and share the screenshot of the same.

                   

                  Best regards,

                  Srinath S

                  • 6. Re: fx2 can read 5039104 bytes

                    Hello srinath,

                    u mean connect FD[7:0] ,FV and LV in the logic analyzer ?

                     

                    Best regards,

                    Sandeep

                    • 7. Re: fx2 can read 5039104 bytes
                      SrinathS_16

                      Hello Sandeep,

                       

                      Yes. I would like to see these traces together when you are receiving continuous 0's on the host application.

                       

                      Best regards,

                      Srinath S

                      • 8. Re: fx2 can read 5039104 bytes

                        Hello srinath,

                        I don't have logic analyzer. Is there any other option to check the FD[7-0] ?

                         

                        Best regards,

                        Sandeep

                        • 9. Re: fx2 can read 5039104 bytes
                          SrinathS_16

                          Hello Sandeep,

                           

                          - Probing the data lines would be helpful. It would help identify if the data is not being received by the FX2LP or if there is an issue with the FX2LP firmware.

                          - Also, does the continuous 0's occur after the same number of bytes are transferred?

                           

                          Best regards,

                          Srinath S

                          • 10. Re: fx2 can read 5039104 bytes

                            Hello srinath ,

                            The continuous zeros occur after every 4194303(0x3FFFFF) bytes.Is there any connection with 8192 packets (4194303=8192*512 packets).

                            Please suggest any logical analyzer with 10 or 12 channel for troubleshooting these kinds of problems.

                             

                            Best regards,

                            Sandeep

                            • 11. Re: fx2 can read 5039104 bytes
                              SrinathS_16

                              Hello Sandeep,

                               

                              FX2LP has not got any restrictions with respect to the data transfer. I am able to transfer 5038592 bytes of data using the Control Center with the BulkSrc example firmware loaded into FX2LP. So, this should be because the data lines from the image sensor is sending 0's.

                               

                              You can use Saleae Logic analyzer to capture the digital traces of the data lines.

                               

                              Best regards,

                              Srinath S

                              • 12. Re: fx2 can read 5039104 bytes

                                Hello srinath ,

                                Please check my TD poll fuction .

                                void TD_Poll( void )

                                {

                                    if(Single)

                                  {

                                        FIFOADR0=0;    //pA1 selecting  Ep6 

                                       SYNCDELAY;

                                       FIFORESET = 0x80;     // activate NAK-ALL to avoid race conditions

                                      SYNCDELAY;

                                     EP6FIFOCFG = 0x00;    //switching to manual mode

                                     SYNCDELAY;

                                     FIFORESET = 0x06;     // Reset FIFO 6

                                     SYNCDELAY;

                                     FIFORESET = 0x00;     //Release NAKALL

                                     SYNCDELAY;

                                     while(IOA & 0x01);     // wait until FV,PA0 Becomes low

                                     while (!(IOA & 0x01)); // wait until FV,PA0 Becomes High

                                     EP6FIFOBUF[0]=0xFF;    // 5bytes of Header used by the Preview Utility         to detect the Start of Transmission

                                     EP6FIFOBUF[1]=0x00;

                                     EP6FIFOBUF[2]=0x0F;

                                     EP6FIFOBUF[3]=0x00;

                                     EP6FIFOBUF[4]=0xFF;

                                     EP6BCH=0x02;        //512 bytes committed

                                     SYNCDELAY;

                                     EP6BCL=0x00;

                                     SYNCDELAY;

                                     FIFORESET = 0x80;      // activate NAK-ALL to avoid race conditions

                                     SYNCDELAY;

                                     EP6FIFOCFG = 0x00;     // switching to manual mode

                                     SYNCDELAY;

                                     FIFORESET = 0x06;      // Reset FIFO 6

                                     SYNCDELAY;

                                     EP6FIFOCFG = 0x0C;     // switching to auto mode

                                    SYNCDELAY;

                                    FIFORESET = 0x00;      //  Release NAKALL

                                    SYNCDELAY;

                                    Single=FALSE;

                                }

                                  }

                                   when i removed the section after selecting  manual mode

                                     FIFORESET = 0x80;      // activate NAK-ALL to avoid race conditions

                                     SYNCDELAY;

                                     EP6FIFOCFG = 0x00;     // switching to manual mode

                                     SYNCDELAY;

                                     FIFORESET = 0x06;      // Reset FIFO 6

                                     SYNCDELAY;

                                     FIFORESET = 0x00;      //  Release NAKALL

                                    SYNCDELAY;

                                 

                                  Header comes correctly in the initial value of the received buffer.

                                please send me a code to read data from the image sensor .

                                Best regards,

                                Sandeep

                                • 13. Re: fx2 can read 5039104 bytes
                                  SrinathS_16

                                  Hello Sandeep,

                                   

                                  Please use the below code in TD_Poll() function block.

                                   

                                  void TD_Poll( void )

                                  {

                                    if(Single)

                                    {

                                      FIFOADR0=0;    //pA1 selecting  Ep6

                                      SYNCDELAY;

                                   

                                      FIFORESET = 0x80;    // activate NAK-ALL to avoid race conditions

                                      SYNCDELAY;

                                      EP6FIFOCFG = 0x00;    //switching to manual mode

                                      SYNCDELAY;

                                      FIFORESET = 0x06;    // Reset FIFO 6

                                      SYNCDELAY;

                                     

                                      while(IOA & 0x01);    // wait until FV,PA0 Becomes low

                                      while (!(IOA & 0x01)); // wait until FV,PA0 Becomes High

                                      EP6FIFOBUF[0]=0xFF;    // 5bytes of Header used by the Preview Utility        to detect the Start of Transmission

                                      EP6FIFOBUF[1]=0x00;

                                      EP6FIFOBUF[2]=0x0F;

                                      EP6FIFOBUF[3]=0x00;

                                      EP6FIFOBUF[4]=0xFF;

                                      EP6BCH=0x02;        //512 bytes committed

                                      SYNCDELAY;

                                      EP6BCL=0x00;

                                      SYNCDELAY;

                                    

                                      EP6FIFOCFG = 0x0C;     // switching to auto mode

                                      SYNCDELAY;

                                      FIFORESET = 0x00;      //  Release NAKALL

                                      SYNCDELAY;

                                      Single=FALSE;

                                    }

                                  }

                                   

                                  In the above code, please let me know how the value of variable 'Single' gets updated. I understand that you are trying to stream video continuously using the FX2LP but your code indicates that you are trying to read only a single frame of data. Please correct me if my understanding is wrong.

                                   

                                  Best regards,

                                  Srinath S

                                  • 14. Re: fx2 can read 5039104 bytes

                                    Hello Srinath,

                                    Thank you for the reply.when i select the LIVE in the Host code the value of the Single is Updated  , Host code works in a while loop  sends vendor command, single is updated  and read xfer data . I changed my code with your TD poll code ,image header works fine but some part is missing .Image is attached here Capture_with header.JPG

                                    The image with my previous code is attached here  in which missing occurs rarely.Full_image_without_heaader.JPG

                                    1 2 Previous Next