4 Replies Latest reply on Mar 1, 2018 6:05 AM by sujayy_46

    Quick question on 20706 UART transport


      Quick question: Provided that I have allocated enough transport buffers, am I able to call wiced_transport_send_buffer() and wiced_transport_send_data() as frequently as I need without overflowing the hardware 1040 Byte transmit FIFO?

        • 1. Re: Quick question on 20706 UART transport

          Related question about wiced_transport buffer pools: the transport internally allocates 32B, 64B and 264B buffer pools, and this takes up about 14KB of memory by my calculation. 


          1) Is there an API to change the internally allocated buffer size and count?

          2) Is there a way to stop the transport from allocating internal buffers? (I'm planning to only use  wiced_transport_send_buffer which uses app allocated transport buffer)

          3) Is there a way to access those internal buffers from my app code?

          4) Is there a way to get usage stats of the internal transport buffer?




          1 of 1 people found this helpful
          • 2. Re: Quick question on 20706 UART transport

            Hi LJ Ye


            We can go to the include/drivers/wiced_transport.h to find the answers. I copy the wiced_transport_send_buffer's api description here:


            * Function         wiced_transport_send_buffer


            *     Send the packet to the host over the hci uart using the buffer allocated by the application.

            *    This function takes care of preparing the header and sending the data. The buffer will be freed

            *    by the transport after sending the packet.


            * Note: Application has to allocate buffer from transport pool using wiced_transport_allocate_buffer

            *         and copy the payload to this buffer and send the payload pointer.

            *         This allows the application to use custom size buffers and avoid overrun of generic buffers,

            *         which is shared across firmware code.




            • 3. Re: Quick question on 20706 UART transport

              The header description does not mention the hardware FIFO at all.


              What about the other questions I asked?

              • 4. Re: Quick question on 20706 UART transport

                wiced_transport_send_data() allocates buffer internally for the data. It uses buffers from the buffer pool you pass during stack init. Maximum size of the buffer that can be allocated is 264 bytes. You can keep calling the API as frequently as required if there are sufficient buffers available and the hardware buffers do not overflow.


                While using wiced_transport_send_buffer(), user will have to allocate buffer for the data. Here again, you can keep calling the API if the application does not run out of buffers and the HW buffers do not overflow.


                1) With the wiced_transport_send_data(), the API will allocate buffer based on the length you pass to it. You cannot change it from application.


                2) You can use the wiced_transport_send_buffer() if you do not wish to use internal buffers.


                3) No access to internal buffers at application level.


                4) You can use wiced_bt_get_buffer_usage() API to get buffer usage details.