This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

No UART output from Printf()

Hi,

I am using an nRF52840 Dongle with an external debugger and an external UART, provided by a USB to UART adapter, its an FTDI board.

I have modified my overlay file, as below to enable the UART which is connected to the FTDI adapter..

&uart0 {
  compatible = "nordic,nrf-uarte";
  current-speed = <115200>;
  status = "okay";
  tx-pin = <29>;
  rx-pin = <31>;
};

I am using the standard Hello_World sample.

#include <zephyr.h>
#include <sys/printk.h>

void main(void)
{
	printk("Hello World! %s\n", CONFIG_BOARD);
}

This did not provide any output. 

I enable the shell in the prj.conf as below.

CONFIG_SHELL=y

This provides an output to the terminal, allowing data to be sent and received.

but Im still not seeing the "Hello World output from printk.

Rod

PS I am able to build and flash blinky so am confident with my tool chain and flashing is working as expected.

Parents Reply
  • Hi Martin,

    No, it doesn't seem to make any difference.

    My overlay file is as follows

    &uart0 {
    //  compatible = "nordic,nrf-uarte";
      compatible = "nordic,nrf-uart"; 
      status = "okay";  
      current-speed = <115200>;
      tx-pin = <29>;
      rx-pin = <31>;
    //  rts-pin = <22>;
    //  cts-pin = <17>;
    };
    

    and my prj.conf file is

    CONFIG_STDOUT_CONSOLE=y
    CONFIG_SHELL=y

    I see this

    with CONFIG_SHELL=y not set, its a black screen

Children
Related