2 Replies Latest reply on Nov 13, 2018 3:50 AM by amal.john_3854616

    How to send a big file as a packet of each 16KB size  through gpif2 interface?

    amal.john_3854616

      Hi,

      I need to send data through GPIF2 interface. For every 16KB of data i need to add header to it and send it through the P-Port.

      Fx3 is used as a master and 32 bit GPIF2 interface is designed.

      Example code used : AN87216 - Designing a GPIF2 Master Interface.

       

      I was able to add header at the beginning but not able to add header at every 16KB of data?

      What are the procedures to be followed for having the callback triggered for every 16KB of data sent? 

        • 1. Re: How to send a big file as a packet of each 16KB size  through gpif2 interface?
          hman

          Hi,

           

          You can do the following:

          1. Configure your DMA  channel buffer size to be 16KB by changing the following:

          channelConfig.size           = 16KB

          2. Configure the header size as following:

          channelConfig.prodHeader     =  (Your header size) //let's say it is 10

           

          I hope your DMA channel is configured as Manual (Since you need to add headers in the firmware)

           

          If the configuration is as above,

          After GPIF fills the DMA buffer with (16KB - 10bytes) of data, a Producer event will be generated which is seen in DMACallback.

          Now while handling the Producer event in DMACallback, the header can be appended.

          In this way for every buffer you can add header and commit it to USB.

           

          For clear understanding of what is explained above, please go through the document and source code of AN75779

          In AN75779 a MutilChannelDMA would be created (but for your requirement you can just focus on how the buffer sizes are configured and how the headers are getting added in dmaCallback.

           

          Regards,

          Hemanth

          • 2. Re: How to send a big file as a packet of each 16KB size  through gpif2 interface?
            amal.john_3854616

            Hi,

            Thanks for your reply.

            I'll look into the document and come back if there is any further doubts.