Re: Help required on reading UART device and print on console

Erwan Gouriou

Hi Digidhamu,

If you're trying to use default UART (through ST link USB port) on nucleo_l476rg, you should use UART_2.


On 6 May 2017 at 09:53, Dhamodharan Krishnan <dhamukrish@...> wrote:

I am a day old since I started in Zephyr and from Arduino background. Could you please help with an example how to read from UART ports which are from (Blinky and Hello World example are working fine).

Here is the code I have tried but failed.

#include <zephyr.h>
#include <misc/printk.h>
#include <uart.h>

int main(void) {

struct device *uartGPS;
uartGPS = device_get_binding(UART_1);

while (1) {
unsigned char* msg;
uart_poll_in(uartGPS, msg);

printk("%s", msg);


Zephyr-devel mailing list

Join to automatically receive all group messages.