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.

UART Interrupt mode blocks

Hello,

We noticed that after sending one byte using GIO_write on Uart2, any subsequent write blocks forever. We use BIOS PSP 3.00.01.00, SYS/BIOS 6.33.05.46, CCS v5.2.1.000018. Anyone else noticed this issue or is it a driver problem?

char *buf=new char[1024];

int size=1;

GIO_write(txHandle, buf, &size);//successfully completes, returns 0 and size==1;

size=1;

GIO_write(txHandle, buf, &size);//this blocks forever

g_uartParams = Uart_PARAMS;
g_uartParams.fifoEnable = true;
g_uartParams.opMode = Uart_OpMode_INTERRUPT;//DMAINTERRUPT;
g_uartParams.baudRate = Uart_BaudRate_115_2K;
g_uartParams.hwiNumber = 9;
g_uartParams.rxThreshold = Uart_RxTrigLvl_1;
g_uartParams.softTxFifoThreshold = 1;
g_uartParams.fc.fcType = Uart_FcType_NONE;
g_uartParams.fc.fcParam = Uart_FcParam_NONE;

Thank you in advance,

David.

  • Hi David,

    Generally, this should not happen. Did you check where exactly it is hung in the driver?. Or is it that no interrupts are being generated?(you can check this by placing a breakpoint in uartIsr(..)). Let me know..

    Best Regards,

    Raghavendra

  • Hi Raghavendra,

    We had to switch to use Interrupt mode since we cannot retrieve the information of remaining bytes using DMA mode after a timeout occurred, not even in callback. As we've seen, the DMA is setup to transfer the size of the buffer, but timeout happens and there's no retrieval from the DMA registers of how many bytes were actually transferred.

    Using interrupt mode we run into write problem which happens for one byte write, which is very simple to prove by modifying the provided BIOSPSP example to read one byte and write it and following subsequent write blocks. If we specify timeout, then it will always return -11 and nothing will be transmitted. We tried the breakpoint in uartIsr, it gets there when first write happened, but it never enters again at the next write. Please see the attached modified example zip file.7180.TestUART.zip

    Best regards,

    David.

  • Hi David,

    Yes, I too observed the same here. Looks like a timing issue. There are multiple interrupts getting generated since we are writing only one byte. 

    Providing you a patch which might fix this issue. Kindly check and let me know..

    Attached is a Uart_diff_report of Uart driver. Please incorporate these changes(as in Uart_modified.c) in the UART driver, rebuild the driver and application, and test your application.

    Best Regards,

    Raghavendra

  • Hi Raghavendra,

    Indeed that fixed our problem, we can successfully send and receive data of any size using Interrupt mode, thank you very much for your kind help.

    Best regards,

    David.

  • Thanks for confirming.

    We will raise an IR and incorporate this fix for the same.

    Best Regards,

    Raghavendra