4 Replies Latest reply on Jul 12, 2018 6:07 AM by bhoomilchavda

    How to detect BULK IN endpoint read request from Linux driver inside FX3 firmware?

    bhoomilchavda

      Hi All,

      I'm new at FX3 USB controller. I have developed my own USB device driver to control FX3 controller. This driver is derived from well known https://elixir.bootlin.com/linux/latest/source/drivers/usb/usb-skeleton.c .

       

      Now I have one question at FX3 firmware side,

      In all examples provided with EZ-USB-SDK, AppStart() function will call from USB event callback function(case SET_CONFIG or SET_INTERFACE). It will create socket and manual or auto channel between producer and consumer. And start transfer data on BULK-IN /OUT or ISO-IN/OUT or INTERRUPT-IN/OUT either in DMA callback function or inside RTOS thread with forever loop.

       

      So on POR, controller always start the stream in or out based on logic flashed in memory. how to control such loop using host driver?

       

      Generally USB master will ask to device about data transfer. For example usb_bulk_msg() or usb_submit_urb() will perform data transfer request and then from/to device we can get/set data .

       

      How can I control FX3 firmware readout on BULK IN pipe using Linux device driver?

       

      Regards,

      Bhoomil C.

        • 1. Re: How to detect BULK IN endpoint read request from Linux driver inside FX3 firmware?
          srdr

          In general, the DATA IN request over the BULK IN endpoint is decoded internally and get the data from the DMA Engine and send it to the host, if there is some data to send to the host.

           

          Otherwise, the USB Endpoint respond ACK TP with  NRDY  TP or STALL TP.

           

          Can you please tell us why do you want to get control of BULK IN packet in the firmware.

           

          Also please eloborate this query: "So on POR, controller always start the stream in or out based on logic flashed in memory. how to control such loop using host driver?"

          • 2. Re: How to detect BULK IN endpoint read request from Linux driver inside FX3 firmware?
            bhoomilchavda

            Hi srdr

            Thanks for your reply.

            So in USBBulkSourceSink example firmware. Source part will copy pattern called 0XAA in dma buffer and then commit buffer. after commit it will throw this out from device to host (am I right?) Now I want like, whenever I request from Linux host then and only it will start commit the dma buffer on BULKIN pipe otherwise not ... so by means of this, I need control over BULK IN pipe.

             

            And USB is master slave protocol, So master only can control device.

             

            But as per your words,

            "the DATA IN request over the BULK IN endpoint is decoded internally get the data from the DMA Engine and send it to the host, if there is some data to send to the host." said that there is something happen at hardware level about this read/write request. Can I access such read request or write request events in FX3 code?

            • 3. Re: How to detect BULK IN endpoint read request from Linux driver inside FX3 firmware?
              srdr

              Bhoomil,

               

              Here commitbuffer API gives the handle of the buffer to the UIB socket ( UIB socket is linked with the USB endpoint). This data will send to BULK IN pipe only when there is a DATA IN request from the host. Otherwise, the data will remain in the buffer until the request comes from the host.

               

              In general, a user does not bother about the BULK IN request in the firmware. Since it is taken care internally. Let us know what is need of it here?

              1 of 1 people found this helpful
              • 4. Re: How to detect BULK IN endpoint read request from Linux driver inside FX3 firmware?
                bhoomilchavda

                I think my doubt is clear for now after reading this line "This data will send to BULK IN pipe only when there is a DATA IN request from the host." thanks...