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
  • Hi Rod,
    Could you please connect a logic analyzer to the pins to actually check if it's sending out anything.

    Did you name the overlay file "nrf52840dongle_nrf52840.overlay"?
    If not the UART0 may still be the default option:

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

  • Hi Martin,

    Yes, I renamed the overlay file. Please can you confirm the name, I think you have typo above, I assume it should be  nrf52840dongle_nrf52840.overlay and not nrf52840dongle_nrf5240.overlay as above?

    I don't have an LA but the FTDI adapter has LEDS which flash when data is passing though. It lights when I have the shell enabled, but not when shell is disabled. 

    I guess my overall file must be correct or I would not be able to transmit and received over the shell?

    Rod

  • Hi Rod,

    Sorry, there was a typo. I've changed the post so it is changed to the correct name: "nrf52840dongle_nrf52840.overlay".
    Verify the tx and rx lines are correct. 

    Usually the issue could actually be having the tx/rx lines switched.

    Please also verify that the FTDI adapter works on another known device, so we can confirm that the adapter is not the issue.

  • Hi Martin,

    I have tried switching the RX and TX lines and I have verified the adapter works on other boards. Surely if there was a hardware problem with a faulty adapter or RX/TX swapped, the shell wouldn't work? As you will see above, I am able to both transmit and receive via the shell which makes me think the hardware is OK? Or am I missing something?

    Rod

Reply Children
No Data
Related