Tool/software:
Hi all,
I am using a UART instance configured in polling mode to read input from a terminal. I am using HTerm as terminal, not the integrated terminal of CCS.
I have a simple application where I read input with DebugP_readLine(pointer to buffer, 100u) and I can observe that UART_readPolling is in its read loop.
Now I send e.g. "foo" with a carriage return char via HTerm. I can see that the buffer is filled with my input but the application will hang forever in the polling read loop.
The problem is caused by a bug in uart_v0_lld.c (from MCU+ SDK v10.00.00.20) in the function UART_fifoRead:
1. While loop checks for 0 != readSizeRemaining
2. readSizeRemaining is never updated inside the loop, only tempReadSizeRemaining is. Therefore the loop will never break from this condition
Because I read input DebugP_readLine, readSizeRemaining will be 1 as it wants to read input character by character:
1. UART_fifoRead returns (size - tempReadSizeRemaining)
2. Because HTerm sends an input string altogether 4 characters have been read and the return value underflowed
3. UART_readPolling never returns although everything has been successfully read.
I guess the CCS terminal sends input after every keystroke unlike HTerm which never makes this bug visible.