This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

calling GIO_submit using UART with EDMA



I have a question, when I am calling GIO_submit(gioChan, cmd, bufp, *pSize, *appCallback), do I have to take care that the data where bufp points to, is avalaible till the data is completely send. Or does GIO_submit copies the data before it comes back?

  • If you pass NULL for *appCallBack then GIO_submit() will execute synchronously, blocking until the operation is complete.  

    If you pass a non-NULL *appCallBack the function can return quickly once the request is queued, and you need to check the return value to see if the operation actually completed (IOM_COMPLETED). 

    A properly written mini-driver will return IOM_COMPLETED only when it is done with the submitted buffer, and the buffer can be reused.

    The GIO API description is in the DSP/BIOS API reference guide (http://www.ti.com/lit/ug/spru403r/spru403r.pdf).

    Scott

  • I thing you don't understand my question. I have a buffer (lets call it buf[128]) uint8_t and using GIO_submit with a callback function, so it will return quickly. I pass the pointer to buffer (&buffer) and lenght to GIO_submit.

    My question is, can I use buffer for other things after GIO_submits returns and the callback function is called?

    With other words, does GIO_submit copies the data (buffer) to a local buffer, before it returns?

  • The callback is called when the I/O request is complete, and the buffer can be used again.  Please see the GIO_submit() description in the API guide: “The appCallback parameter points to either a callback structure that contains the callback function to be called when the request completes, or it points to NULL, which causes the call to be synchronous. When a queued request is completed, the callback routine (if specified) is invoked”.

    GIO_submit() does not copy the data buffer.  It passes a descriptor of the buffer (the pointer and size) to the mini driver for doing the actual I/O.