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

can not printk hello world to uart0

refer to:
https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrf91_dk%2FUG%2Fnrf91_DK%2Fboard_controller.html
devzone.nordicsemi.com/.../problem-with-uart0-on-nrf9160dk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hardware
SW10 turn to NRF52
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

create in
~/ncs/zephyr/samples/hello_world/nrf9160dk_nrf52840.overlay
&uart0 {
    compatible = "nordic,nrf-uarte";
    current-speed = <115200>;
    status = "okay";
    tx-pin = <5>;
    rx-pin = <3>;
    rts-pin = <0xffffffff>;
    cts-pin = <0xffffffff>;
};

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~/ncs/zephyr/boards/arm/nrf9160dk_nrf52840/nrf9160dk_nrf52840_defconfig
#add
CONFIG_UART_INTERRUPT_DRIVEN=y

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SES  IDE
project Hello world
Board Name: nrf9160dk_nrf52840

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.config
#
# Serial Drivers
#
CONFIG_UART_NRFX=y
CONFIG_UART_0_NRF_UARTE=y
CONFIG_UART_0_ENHANCED_POLL_OUT=y
# CONFIG_UART_0_NRF_PARITY_BIT is not set
CONFIG_UART_0_NRF_TX_BUFFER_SIZE=32
CONFIG_NRF_UARTE_PERIPHERAL=y
# CONFIG_UART_ALTERA_JTAG is not set
# CONFIG_UART_XLNX_UARTLITE is not set

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
another rs232 usb
cat /dev/ttyUSB0

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

can not read any char from Uart0, how do i do?  need help

Parents
  • Hello,

    Honestly, I’m not quite sure what you are trying to achieve. But if you just want to use different pins on the DK for the nRF9160 UART0 peripheral, you should name the overlay-file nrf9160dk_nrf9160.overlay (or nrf9160dk_nrf9160ns.overlay, respectively) and add your content there:

    &uart0 {
        compatible = "nordic,nrf-uarte";
        current-speed = <115200>;
        status = "okay";
        tx-pin = <5>;
        rx-pin = <3>;
        rts-pin = <0xffffffff>;
        cts-pin = <0xffffffff>;
    };

    Regards,

    Markus

Reply
  • Hello,

    Honestly, I’m not quite sure what you are trying to achieve. But if you just want to use different pins on the DK for the nRF9160 UART0 peripheral, you should name the overlay-file nrf9160dk_nrf9160.overlay (or nrf9160dk_nrf9160ns.overlay, respectively) and add your content there:

    &uart0 {
        compatible = "nordic,nrf-uarte";
        current-speed = <115200>;
        status = "okay";
        tx-pin = <5>;
        rx-pin = <3>;
        rts-pin = <0xffffffff>;
        cts-pin = <0xffffffff>;
    };

    Regards,

    Markus

Children
Related