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.

RTOS/TDA2PXEVM: Getting data over uart handle using GIO_read

Part Number: TDA2PXEVM
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hello ,

For our project we are using TDA2px-evm in sysbios all configuration and PSDK3.03.

In one of the requirement, I need to read data over UART interface from GPS device.

To simulate and test the device driver, i am using UART1 instance (same as used for console i/o) and to read over uart , i am using the GIO_API

GIO_read(uartRxHandle, &local_buf, &bufferLength) , where uartRxHandle -uart handle for uart1, local_buf is local buffer and bufferLenght is data length.

The code is placed at ..\PROCESSOR_SDK_VISION_03_03_00_00/vision_sdk/apps/src/rtos/modules/<device_driver>, following is the code snippet.

GIO_Handle       uartRxHandle;
 UInt8 local_buf[240] = {0};
 size_t  bufferLength = (size_t)240;
 checkUART4Instance((Void*)&uartRxHandle);

  if(uartRxHandle == NULL) {
        ret =STATUS_ERRCONFIG;
        return ret;
    }

  while(1) {         
               if(IOM_COMPLETED == GIO_read(uartRxHandle, &local_buf, &bufferLength))
               {

But when I execute the same, I get following exception,

ti.sysbios.io.GIO: line 351: ti.sysbios.io.GIO: line 351: assertion failure: A_badModel: invalid use of API for current I/O model
xdc.runtime.Error.raise: terminating execution

Will you please let me  know if I am missing something here.

regards

Hrishikesh

  • Hi,

    When you create the driver handle, you provide the driver model as part of GIO_Param.

    GIO supports two models Standard and IssueReclaim, The APIs supported in both are different.

    In case of standard mode, GIO_read and GIO_write are supported. In case of IssueReclaim model, GIO_Issue and GIO_reclaim are supported.

    Please check the mode you have used for creating the driver handle.

    Regards,
    Prasad

  • Hi Prasad,
    Thanks for the reply, I am using the same uartRx handle used in uart0 (used for console) for my testing with GIO_read() API.
    meanwhile I have found a bug in my code which i am trying to fix and get back to you if the issue remains.
    Meanwhile can we use use IssueReclaim module in UART ?
    regards
    Hrishikesh
  • Hi Hrishikesh,

    The Uart driver is verified with the Standard mode, So please use the GIO_read/GIO_write APIs.

    Regards,
    Prasad