Unable to get UART log output on nRF9151 DK

This seems like a silly issue, but I cannot get the UART output from the nRF9151 DK. Attached is a project that outputs via both LOG and printk() to a Segger RTT viewer without issue, but does not from UART (USB virtual via the DK). I normally use J-Link RTT but recently opened a DevZone ticket where part of the follow-up was to eliminate RTT from the project and try to reproduce the firmware fault.

The attached zip contains the whole project, I am using SDK v3.0.2. If the CONFIG_RTT_CONSOLE is set to "y" works perfectly. Change RTT to "n", CONFIG_UART_CONSOLE=y and no output. I have tried build for both with/without TFM. 

# to use Segger RTT in any capacity
CONFIG_USE_SEGGER_RTT=y

# setup CONSOLE behavior
CONFIG_CONSOLE=y
CONFIG_RTT_CONSOLE=n
CONFIG_UART_CONSOLE=y

# setup LOG facility behavior
CONFIG_LOG=y
CONFIG_LOG_PRINTK=y
CONFIG_LOG_MODE_IMMEDIATE=y

*** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
*** Using Zephyr OS v4.0.99-f791c49f492c ***
Hello World! nrf9151dk/nrf9151/ns
[00:00:00.409,759] <inf> main: LOG can say Hello World too.
It is also possible to use printk... Hello world!
.
,
Hello World! nrf9151dk/nrf9151/ns
[00:00:02.410,644] <inf> main: LOG can say Hello World too.
It is also possible to use printk... Hello world!
*** Booting nRF Connect SDK v3.0.2-89ba1294ac9b ***
*** Using Zephyr OS v4.0.99-f791c49f492c ***
Hello World! nrf9151dk/nrf9151/ns
[00:00:22.811,248] <inf> main: LOG can say Hello World too.
It is also possible to use printk... Hello world!
.
,
Hello World! nrf9151dk/nrf9151/ns
[00:00:24.812,133] <inf> main: LOG can say Hello World too.
It is also possible to use printk... Hello world!
.
,
Hello World! nrf9151dk/nrf9151/ns
[00:00:26.813,018] <inf> main: LOG can say Hello World too.
It is also possible to use printk... Hello world!
.
,
Hello World! nrf9151dk/nrf9151/ns
[.
,
Hello World! nrf9151dk/nrf9151/ns
[00:00:34.835,510] <inf> main: LOG can say Hello World too.
It is also possible to use printk... Hello world!

3666.hello_world.zip

Parents
  • Hello,

    I tried running your code and it did successfully print on the UART. I did not do any modifications.

    Can you please provide full build config found in build/app_name/zephyr/.config and also zephyr.dts found in the same location? Also, can you describe what OS and program used to read the serial port? What are your settings there?

  • Files requested are attached in zip.

    Windows 11 is workstation OS. Tried using nRF Connect for Desktop, Serial Terminal and the nRF Terminal within VSCode. The 2nd virtual COM port attach the the TF-M works, I get a startup message on reset press (for both Desktop Serial Terminal and VSCode nRF Terminal). I have tried this on 2 different nRF9151 DK boards.

    8032.build_files.zip

  • Are you using an overlay file that you did not upload in the zip? I get this when I diff your zephyr.dts file with mine

  • No overlay, double checked. I don't see the register addresses in my 9151 board pinctrl file, that must get translated during build into the dts file.

    Should I reinstall SDK 3.0.2?nrf9151dk_nrf9151_common-pinctrl.dtsinrf9151dk_nrf9151_common.dtsi

  • gterrell said:

    Have you changed nrf9151dk_nrf9151_common-pinctrl.dtsi? It should look like this

    /*
     * Copyright (c) 2023 Nordic Semiconductor
     * SPDX-License-Identifier: Apache-2.0
     */
    
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 27)>,
    				<NRF_PSEL(UART_RTS, 0, 14)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 26)>,
    				<NRF_PSEL(UART_CTS, 0, 15)>;
    			bias-pull-up;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 27)>,
    				<NRF_PSEL(UART_RX, 0, 26)>,
    				<NRF_PSEL(UART_RTS, 0, 14)>,
    				<NRF_PSEL(UART_CTS, 0, 15)>;
    			low-power-enable;
    		};
    	};
    
    	uart1_default: uart1_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 29)>,
    				<NRF_PSEL(UART_RTS, 0, 16)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 28)>,
    				<NRF_PSEL(UART_CTS, 0, 17)>;
    			bias-pull-up;
    		};
    	};
    
    	uart1_sleep: uart1_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 29)>,
    				<NRF_PSEL(UART_RX, 0, 28)>,
    				<NRF_PSEL(UART_RTS, 0, 16)>,
    				<NRF_PSEL(UART_CTS, 0, 17)>;
    			low-power-enable;
    		};
    	};
    
    	i2c2_default: i2c2_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 30)>,
    				<NRF_PSEL(TWIM_SCL, 0, 31)>;
    		};
    	};
    
    	i2c2_sleep: i2c2_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 30)>,
    				<NRF_PSEL(TWIM_SCL, 0, 31)>;
    			low-power-enable;
    		};
    	};
    
    	pwm0_default: pwm0_default {
    		group1 {
    			psels = <NRF_PSEL(PWM_OUT0, 0, 0)>;
    		};
    	};
    
    	pwm0_sleep: pwm0_sleep {
    		group1 {
    			psels = <NRF_PSEL(PWM_OUT0, 0, 0)>;
    			low-power-enable;
    		};
    	};
    
    	spi3_default: spi3_default {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
    				<NRF_PSEL(SPIM_MISO, 0, 12)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 11)>;
    			nordic,drive-mode = <NRF_DRIVE_H0H1>;
    		};
    	};
    
    	spi3_sleep: spi3_sleep {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
    				<NRF_PSEL(SPIM_MISO, 0, 12)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 11)>;
    			low-power-enable;
    		};
    	};
    };
    

Reply
  • gterrell said:

    Have you changed nrf9151dk_nrf9151_common-pinctrl.dtsi? It should look like this

    /*
     * Copyright (c) 2023 Nordic Semiconductor
     * SPDX-License-Identifier: Apache-2.0
     */
    
    &pinctrl {
    	uart0_default: uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 27)>,
    				<NRF_PSEL(UART_RTS, 0, 14)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 26)>,
    				<NRF_PSEL(UART_CTS, 0, 15)>;
    			bias-pull-up;
    		};
    	};
    
    	uart0_sleep: uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 27)>,
    				<NRF_PSEL(UART_RX, 0, 26)>,
    				<NRF_PSEL(UART_RTS, 0, 14)>,
    				<NRF_PSEL(UART_CTS, 0, 15)>;
    			low-power-enable;
    		};
    	};
    
    	uart1_default: uart1_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 29)>,
    				<NRF_PSEL(UART_RTS, 0, 16)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 28)>,
    				<NRF_PSEL(UART_CTS, 0, 17)>;
    			bias-pull-up;
    		};
    	};
    
    	uart1_sleep: uart1_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 29)>,
    				<NRF_PSEL(UART_RX, 0, 28)>,
    				<NRF_PSEL(UART_RTS, 0, 16)>,
    				<NRF_PSEL(UART_CTS, 0, 17)>;
    			low-power-enable;
    		};
    	};
    
    	i2c2_default: i2c2_default {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 30)>,
    				<NRF_PSEL(TWIM_SCL, 0, 31)>;
    		};
    	};
    
    	i2c2_sleep: i2c2_sleep {
    		group1 {
    			psels = <NRF_PSEL(TWIM_SDA, 0, 30)>,
    				<NRF_PSEL(TWIM_SCL, 0, 31)>;
    			low-power-enable;
    		};
    	};
    
    	pwm0_default: pwm0_default {
    		group1 {
    			psels = <NRF_PSEL(PWM_OUT0, 0, 0)>;
    		};
    	};
    
    	pwm0_sleep: pwm0_sleep {
    		group1 {
    			psels = <NRF_PSEL(PWM_OUT0, 0, 0)>;
    			low-power-enable;
    		};
    	};
    
    	spi3_default: spi3_default {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
    				<NRF_PSEL(SPIM_MISO, 0, 12)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 11)>;
    			nordic,drive-mode = <NRF_DRIVE_H0H1>;
    		};
    	};
    
    	spi3_sleep: spi3_sleep {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
    				<NRF_PSEL(SPIM_MISO, 0, 12)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 11)>;
    			low-power-enable;
    		};
    	};
    };
    

Children
Related