1 Reply Latest reply on Jul 29, 2018 10:57 PM by rajivv_36

    Can not enter UART Rx interrupt function !!!

      Hello ,

      I need help about Receiving Data by UART, because when I send data by PC tool, the process can not  interrupt function,  but if I use XX_UartPutChar() to send the data back, I can receive the data by PC tool, that means the board had received data,  but why it can not enter the interrupt function ?  I am very appreciate if  anyone can give some help ,   thank you very much !

      picture 1:  pins of Design Wide Resource,  pin 21 and pin 22 are UART rx and UART tx.  my UART's name is DBUS.

      picture 2:  UART config.

      picture 3: main fuction.

      picture 4: default interrupt function.



      thank you very much !!!

        • 1. Re: Can not enter UART Rx interrupt function !!!



          You can use the callback function. Here are the steps-

          1. In the UART component customizer, enable the type of RX interrupt you want. For example, "RX FIFO not Empty"

          2. In the cyapicallbacks.h file, add the following statements to declare the callback back function-

               #define DBUS_SPI_UART_ISR_ENTRY_CALLBACK

               void DBUS_SPI_UART_ISR_EntryCallback();


               In the DBUS_SPI_UART_INT.c (under generated_source), you will notice that the callback function is activated under

              #ifdef UART_1_SPI_UART_ISR_ENTRY_CALLBACK

          3. Write the function DBUS_SPI_UART_ISR_EntryCallback() in your .c file.


          Note that you can either use EntryCallBack() function or ExitCallBack() function. As you SW buffer is not enabled, it will not make any difference here. But if you enable SW buffer (by keeping RX or TX buffer size greater than 8), you need to be careful about the selection.