1 2 3 4 Previous Next 47 Replies Latest reply on Nov 15, 2019 11:32 AM by maVa_1182686 Go to original post
      • 30. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
        HemanthR_06

        Hi,

         

        Yes.This looks correct. FX3 sends 4kB for every second. Record the trace for few seconds and analyze.

         

        Regards,

        Hemanth

        • 31. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
          maVa_1182686

          Hi,

           

          I have analyzed the data and see the packets you sent every second and the pattern that you put in them.

           

          I doesn't reproduce my situation as there no empty or incomplete(not full) packets.

           

          I'm not sure what I'm supposed to take away from this?

          Does it mean that the  API indeed does not allow you to reliable get the data out of my streams

          (even though in wireshark my data is completely logical) ?

          Does this mean that I have to reprogram my FX3 to never ever send anything "incomplete"...which would make it behave more like your application?

           

          That's what I need to know...Is my problem intended behaviour or not???

           

          And if it is intended behaviour (which would be really weird in my opinion), what is the most efficient way to keep the FX3 from sending incomplete chunks?

          • 32. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
            HemanthR_06

            Hi,

             

            In my test, I always send 4KB whereas requested data is 8(ppx) * 4KB = 32KB. So the data sent is not as requested. But I do not have non-1024 byte packets in the data. Do you have non-1024 byte sized packets in your stream? If so, I need to incorporate that in the test.

             

            What can be found from this test is:

            - If you send data less than requested in one transfer (which is equal to PPX*CY_FX_ISO_PKTS*CY_FX_ISO_BURST*1024) and is equal to 1K multiple, then FinishDataXfer behaves correctly.

             

            a. Can you please also let me know which OS are you testing on? (If Windows 10 what is the build number?)

            b. What is the version of cyusb3 driver that you are using?

             

            Regards,

            Hemanth

            • 33. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
              maVa_1182686

              Hi,

              I do not have non 1024 packets in my stream. Always multiples of 1024 or empty packets.

               

              What can be found from this test is:

              - If you send data less than requested in one transfer (which is equal to PPX*CY_FX_ISO_PKTS*CY_FX_ISO_BURST*1024) and is equal to 1K multiple, then FinishDataXfer behaves correctly.

               

              I disagree. You only have 4kB messages which are that long becaus the FX3 firmware keeps them that small. I understand this can work but i do not know how to achieve this in a real world scenario which has a real GPIFII state machine attached to it.

              If the solution to my problem is in fact changing the FX3s firmware...ok...so be it. I just can not get however that the API is not able to handle my data stream.

               

              In the end, I do the same thing:  I send data less than requested but also equal to multiples of 1kB and while the data isn't in chunks of the same size, wireshark clearly shows the data inside to be perfectly normal.

               

              I do not know why the GPIFII in my FX3 does not "save up" and waits to send anything before a enough data has been produced so that all it sends are either the "right" size or size 0 (when there is no data)

               

              I just want to know why the API does not work like that when clealy the data is correct over the USB bus.

               

               

              a. Can you please also let me know which OS are you testing on? (If Windows 10 what is the build number?)

              I have seen the issue on all my computers. They all are windows 10 though and the one i'm on now is

              b. What is the version of cyusb3 driver that you are using?

              1.2.3.23

               

               

              Best regards,

              Mattijs

               

               

              • 34. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                HemanthR_06

                Hi Mattijs,

                 

                Can you please suggest the data size sequence that you might find in your application(assuming ppx=8; CY_FX_ISO_PKTS=1; CY_FX_ISO_BURST=4; DMA Buffer Size=4KB)? So that I will try to achieve the same to reproduce the problem?

                 

                Regards,

                Hemanth

                • 35. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                  HemanthR_06

                  Hi Mattijs,

                   

                  I will try for this sequence - 1K, 2K, 3K, 4K, 1K...and let you know.

                   

                  Regards,

                  Hemanth

                  • 36. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                    maVa_1182686

                    Hi Hemanth,

                    I'm not sure that achieves my issue.

                    With a 1K (or <4kB) payload you are taking only a part of a DMA buffer (4burst*1024)

                    In my situation there is  logical and sequential data in chunks that are multiples of the size of the DMA buffer (4kB), but fewer than 8 of those (if you set packets per Xfer to 8 ).

                     

                    Best Regards,

                    Mattijs

                    • 37. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                      HemanthR_06

                      Hi Mattijs,

                       

                      Then I can try sending 4K, 8K, 12K, 16K, 4K,..which is 1 buffer, 2 buffers, 3 buffers, 4 and 1 again. Would this be okay?

                       

                      Regards,

                      Hemanth

                      • 39. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                        HemanthR_06

                        Hi Mattijis,

                         

                        Please test with the attached firmware and let me know if you can see the issue. Also analyze the time difference between 4K packets.

                         

                        Regards,

                        Hemanth

                        • 40. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                          maVa_1182686

                          I'm running your Firmware and changed it so it has a throughput more like my application (+-8MB/s) by changing your sleep(1000) statement to sleep(1) in the IsoSrcSinkAppThread_Entry loop.

                          The higher throughput makes it slightly easier to see what's going on in wireshark.

                          What I find a little strange is that there are so many failed transmissions?

                           

                           

                          Have you tested the sequence with your streamer app?

                           

                          I will rewrite mine and see if I can get the pattern out of your data.

                           

                          If i can't it means you reproduced my situation so i'm hoping i can't !

                           

                          Regards,

                          Mattijs

                          • 41. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                            HemanthR_06

                            Below is my streamer screenshot:

                            And the data taken out from FinishDataXfer:

                             

                            Regards,

                            Hemanth

                            • 42. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                              maVa_1182686

                              I can now reproduce my issue with your Firmware!

                              This is my debug read out.

                              I basically print the ENTIRE xbuf every time just to try to see the pattern. (The first element of every 1024 bytes of the entire buffer...not the entire buffer obviously)

                              It is printed to console every time you go through the finishXfer loop.

                              I set Xfers to queue to 1 just so k is always 0  (xBuf[k]), I print k too but that is not useful right now.

                               

                              It all boils down to me not knowing where to take the data from the xBuf as it seems to be put there at a random location.

                              I can't see the pattern.

                               

                               

                              BOLD indicates actual debug, comments are not bold

                              The *** starts indicate the position in the xBuf where I would think the new data should be

                              The /// indicates a position in the xBuf that to my understanding is not written to because length pkts < length xBuf

                               

                               

                              In the first debug information the data at the start of a 1024 boundary goes from 52 => 63

                              It gets placed in position 1=>12 in the xbuf. This seems logical to me

                               

                               

                               

                               

                              CONSOLE :

                               

                              length xBuf=  32768

                              length pkts=  12288

                              k= 0

                              test:

                              ***  52    <= seems OK

                              ***  53

                              ***  54

                              ***  55

                              ***  56

                              ***  57

                              ***  58

                              ***  59

                              ***  60

                              ***  61

                              ***  62

                              ***  63

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              *************************

                               

                              length xBuf=  32768

                              length pkts=  8192

                              k= 0

                              test:

                              ***  64   <= OK TOO.. payload is sequential...last xFer 52=>63, this starts at 64 and goes to 71 in 88 steps (length pkts=  8192)

                              ***  65

                              ***  66

                              ***  67

                              ***  68

                              ***  69

                              ***  70

                              ***  71

                              ///  60

                              ///  61

                              ///  62

                              ///  63

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              *************************

                               

                              length xBuf=  32768

                              length pkts=  12288

                              k= 0

                              test:

                              ***  64

                              ***  65

                              ***  66

                              ***  67

                              ***  68

                              ***  69

                              ***  70

                              ***  71

                              ***  60

                              ***  61

                              ***  62

                              ***  63

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  72      <=== FIRST PROBLEM!!!!!!   The payload goes from 71 to 83...BUT WHY on this location in xBUF?? How should I know where to take data in the future???

                              ///  73

                              ///  74

                              ///  75

                              ///  76

                              ///  77

                              ///  78

                              ///  79

                              ///  80

                              ///  81

                              ///  82

                              ///  83

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              *************************

                               

                              length xBuf=  32768

                              length pkts=  4096

                              k= 0

                              test:

                              ***  84          <= Here the payload continues at 84 => 87...but in the start position again???

                              ***  85

                              ***  86

                              ***  87

                              ///  68

                              ///  69

                              ///  70

                              ///  71

                              ///  60

                              ///  61

                              ///  62

                              ///  63

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  72

                              ///  73

                              ///  74

                              ///  75

                              ///  76

                              ///  77

                              ///  78

                              ///  79

                              ///  80

                              ///  81

                              ///  82

                              ///  83

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              *************************

                               

                              length xBuf=  32768

                              length pkts=  8192

                              k= 0

                              test:

                              ***  88

                              ***  89

                              ***  90

                              ***  91

                              ***  92

                              ***  93

                              ***  94

                              ***  95

                              ///  60

                              ///  61

                              ///  62

                              ///  63

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  72

                              ///  73

                              ///  74

                              ///  75

                              ///  76

                              ///  77

                              ///  78

                              ///  79

                              ///  80

                              ///  81

                              ///  82

                              ///  83

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              *************************

                               

                              length xBuf=  32768

                              length pkts=  12288

                              k= 0

                              test:

                              ***  88

                              ***  89

                              ***  90

                              ***  91

                              ***  92

                              ***  93

                              ***  94

                              ***  95

                              ***  60

                              ***  61

                              ***  62

                              ***  63

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  72

                              ///  73

                              ///  74

                              ///  75

                              ///  96

                              ///  97

                              ///  98

                              ///  99

                              ///  100

                              ///  101

                              ///  102

                              ///  103

                              ///  104

                              ///  105

                              ///  106

                              ///  107

                              *************************

                               

                              length xBuf=  32768

                              length pkts=  4096

                              k= 0

                              test:

                              ***  108

                              ***  109

                              ***  110

                              ***  111

                              ///  92

                              ///  93

                              ///  94

                              ///  95

                              ///  60

                              ///  61

                              ///  62

                              ///  63

                              ///  165

                              ///  165

                              ///  165

                              ///  165

                              ///  72

                              ///  73

                              ///  74

                              ///  75

                              ///  96

                              ///  97

                              ///  98

                              ///  99

                              ///  100

                              ///  101

                              ///  102

                              ///  103

                              ///  104

                              ///  105

                              ///  106

                              ///  107

                              *************************

                               

                              The thread 0x2cdc has exited with code 0 (0x0).

                              • 43. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                                maVa_1182686

                                It gets even crazier...when I speed up your code by only doing sleep (1) there are "holes" in the positions where new data is put.

                                I changed my streamer just slightly and now I always delete the content of the xBuf so it's clearer where the new data is being put.

                                 

                                length xBuf=  32768

                                length pkts=  12288

                                k= 0

                                test:

                                ***  208

                                ***  209

                                ***  210

                                ***  211

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  212

                                ///  213

                                ///  214

                                ///  215

                                ///  216

                                ///  217

                                ///  218

                                ///  219

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                *************************

                                 

                                 

                                length xBuf=  32768

                                length pkts=  16384

                                k= 0

                                test:

                                ***  220

                                ***  221

                                ***  222

                                ***  223

                                ***  224

                                ***  225

                                ***  226

                                ***  227

                                ***  228

                                ***  229

                                ***  230

                                ***  231

                                ***  232

                                ***  233

                                ***  234

                                ***  235

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                *************************

                                 

                                 

                                length xBuf=  32768

                                length pkts=  20480

                                k= 0

                                test:

                                ***  236

                                ***  237

                                ***  238

                                ***  239

                                ***  240

                                ***  241

                                ***  242

                                ***  243

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  244

                                ***  245

                                ***  246

                                ***  247

                                ***  248

                                ***  249

                                ***  250

                                ***  251

                                ///  252

                                ///  253

                                ///  254

                                ///  255

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                *************************

                                 

                                 

                                length xBuf=  32768

                                length pkts=  12288

                                k= 0

                                test:

                                ***  0

                                ***  1

                                ***  2

                                ***  3

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ///  4

                                ///  5

                                ///  6

                                ///  7

                                ///  8

                                ///  9

                                ///  10

                                ///  11

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                *************************

                                 

                                 

                                length xBuf=  32768

                                length pkts=  16384

                                k= 0

                                test:

                                ***  12

                                ***  13

                                ***  14

                                ***  15

                                ***  16

                                ***  17

                                ***  18

                                ***  19

                                ***  20

                                ***  21

                                ***  22

                                ***  23

                                ***  24

                                ***  25

                                ***  26

                                ***  27

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                *************************

                                 

                                 

                                length xBuf=  32768

                                length pkts=  20480

                                k= 0

                                test:

                                ***  28

                                ***  29

                                ***  30

                                ***  31

                                ***  32

                                ***  33

                                ***  34

                                ***  35

                                ***  36

                                ***  37

                                ***  38

                                ***  39

                                ***  40

                                ***  41

                                ***  42

                                ***  43

                                ***  44

                                ***  45

                                ***  46

                                ***  47

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                *************************

                                 

                                 

                                length xBuf=  32768

                                length pkts=  12288

                                k= 0

                                test:

                                ***  48

                                ***  49

                                ***  50

                                ***  51

                                ***  0

                                ***  0

                                ***  0

                                ***  0

                                ***  52

                                ***  53

                                ***  54

                                ***  55

                                ///  56

                                ///  57

                                ///  58

                                ///  59

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                ///  0

                                *************************

                                • 44. Re: Issues with isoc.FinishDataXfer(ref cBufs[k], ref xBufs[k], ref len, ref oLaps[k], ref pktsInfo[k]))
                                  HemanthR_06

                                  Hi Mattijs,

                                   

                                  Please program the firmware that I have given you yesterday ( with which the issue is reproduced - I hope Thread(1000) is not changed when the issue is seen)

                                  Then run the attached streamer application which creates FinishData.bin in the same directory where the application is.

                                  -> Choose IN Endpoint; Choose 8 as PPX and 1 in Queue.

                                  Note:

                                  1. Every time you run this application, if FinishData.bin file exists it deletes and creates new. (Letting you know in case you have some other file with same name)

                                  2. open the FinishData.bin file after closing Streamer.

                                   

                                  Please test and let me know if the pattern obtained in the file is correct.

                                   

                                  Regards,

                                  Hemanth