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.

TI-RTOS - UART Echo Tiva TM4C1294.

UART Echo Tiva TM4C1294. Works ok.

However want to create an interrupt to run for example UARTIntHandler () function when the UART RX receives data. Where is the vector table of interruptions to run UARTIntHandler ()? I can not make a HWI because the interrupt has now been initiated.

Regards

  • Hi,
    The TI-RTOS UART driver internally uses a Hwi to manage the UART interrupt so you're right, that interrupt number is already used. Why do you have need to create your own ISR? If you're using the TI-RTOS driver, you can't do this. An option will be to use the TI-RTOS UART driver in callback mode. In callback mode, you provide your own call back function that would be called after any UART read or write call. The other option will be not to use the TI-RTOS UART driver and use TivaWare's UART driver and manually create and manage your Hwi.

    Let me know what you think.

    Moses
  • Hi Moses
    Many thanks for your quick response.
    What thou said, was really what I was thinking. However I was planning to use the TI-RTOS UART driver.

    What I need to do, is be to listen to the RX by uart interrupt, the wait entering data. When it happens, the interrupt will save the data in a buffer that later (us) the data will be read by the application. For this my idea was to create a HWI that comes to sending the data it receives in RX. Here would read the data and be one semaphore that would come when the command was all received.

    With the TI-RTOS UART can not seem to do this, I think I can not even use the uart interrupt, which leaves little flexibility. As you say, well, I have to use the driver UART TIVA.


    Regards

  • However how could use TI-RTOS UART driver in callback mode?

    I think that could be ma good solution to use the TI-RTOS UART.

    Regards
  • {
        UART_Handle handle;
        UART_Params uartParams;
    
        /* Create a UART with the parameters below. */
        UART_Params_init(&uartParams);
        uartParams.writeMode = UART_MODE_CALLBACK;
        uartParams.readMode = UART_MODE_CALLBACK;
        uartParams.writeCallback = &writeCallback;
        uartParams.readCallback = &readCallback;
        handle = UART_open(Board_UART1, &uartParams);
        if (handle == NULL) {
            System_abort("Error creating UART!");
        }
    }
    
    
    void writeCallback(UART_Handle handle, void *buffer, size_t num)
    {
    }
    
    void readCallback(UART_Handle handle, void *buffer, size_t num)
    {
    }
    

    The code above creates an instance of the UART driver in callback mode. As you can see, you can set callback mode for either read or write transfers or both. The code above does both. The callback functions passed in are writeCallback and readCallback for write and read transfers respectively. Take a look at UART.h in <TI-RTOS_INSTALL_DIR>/packages/ti/drivers to see the function prototype of a UART Callback function.


    Let me know if this helps.

    Moses

  • Hi Moses,
    Thank you, for your reply. I think it will be a good solution.
    I'm really starting to use the TI-RTOS, and liked to use the available functions.

    Regards
  • Hi Guys, 

    I am using the readcallback as Moses suggested but when I check the read buffer  I have the same data I sent with the UART_write()...I am a bit confused...

    any idea?

    Thanks

  • Hi Gianluca,

        Can you make a fresh post on your issue? I'll recommend  adding more details like what version of TI-RTOS you're using, the device your building for and even snippets of your code so we can answer it faster.

    Thanks,

    Moses

  • Hi Moses, thanks for the answer. Actually there is another post for my issue but I did not get any feedback in the last 10 days. If you can take a look I would really appreciate that. The post is this: e2e.ti.com/.../1703000
    There you can also see all the information.
    Thank you