Re: Example of how use UART to communicate with a LTE modem #stm32 #uart


Peter A. Bigot
 

Based on the documentation uart_poll_in returns zero to indicate a character arrived.  A negative value, which you're checking for in your code, would indicate the operation failed.  Chances are it's working, and you're discarding the received characters without displaying them.

Peter

On 11/30/18 9:59 AM, Gustavo FN wrote:
    printk("Infinite Loop to read the response from uart1");
    while (1) {
unsigned char recvChar;
while (uart_poll_in(uart, &recvChar) < 0)
printk("%c", recvChar);
    }
}

What I'm missing? This code should send the command "AT" to the modem and the loop should expect to print the "OK" back.

Join users@lists.zephyrproject.org to automatically receive all group messages.