Debug Log not shown in RTT either Uart in custom pcb of 9160

Hello Nordic Team,

My application is cellular asset tracker type and we have design custom pcb using nRF9160 device.

I am using ncs SDK version: v2.8.0 and toolchain version: v2.8.0 and I have flased latest modem firmware nrf9160dk_mfw-1.3.7_sdk-2.8.0 in my PCB.

Now, I am try to flash default example code like asset_tracker_v2,at_monitor,gnss according to my use cases.

I have manage proper build configuration and also added my custom cellular_telemetric_devise.overlay file for change default Uart0 pin to my custom pcb. I have attached file for your reference.

cellular_telemetric_devise.overlay

But I can't see log over Uart to TTL. I have also try using RTT enable and try to view NRF log in RTT viewer but not showing any log. I have try same build and .overlay file in nRF9160 dk Kit in that all things working properly it's redirect log default Uart0 to my custom defined Uart1 pin and i can see log and also RTT log on RTT viwer.

Below are main changes made in different example code in default prj.conf file for RTT Log and Uart Log. I have attached asset_tracker_v2 prj.conf file for your reference

70678.prj.conf

### Logger module
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y
CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG=y
CONFIG_LOG_MODE_DEFERRED=y
CONFIG_LOG_BACKEND_UART=n
CONFIG_LOG_SPEED=y
CONFIG_UART_CONSOLE=n

Meanwhile after flashing I showed Uart log which i share below,

In GNSS example : 

All pins have been configured as non-secure
[1;34mBooting TF-M v2.1.1-ncs1[0m
[1;34m[Sec Thread] Secure image initializing![0m
TF-M Float ABI: Hard
Lazy stacking enabled

In at_monitor:

All pins have been configured as non-secure
[1;34mBooting TF-M v2.1.1-ncs1[0m
[1;34m[Sec Thread] Secure image initializing![0m

Kindely help me to enable both Uart log and RTT log in my custom PCB. Is there any additional macro add into prj.conf file? or any other changes.

It will really help me to move forward my task.

  • Hi,

     

    In GNSS example : 

    All pins have been configured as non-secure
    [1;34mBooting TF-M v2.1.1-ncs1[0m
    [1;34m[Sec Thread] Secure image initializing![0m
    TF-M Float ABI: Hard
    Lazy stacking enabled

    In at_monitor:

    All pins have been configured as non-secure
    [1;34mBooting TF-M v2.1.1-ncs1[0m
    [1;34m[Sec Thread] Secure image initializing![0m

    These are not the application log output, but rather the TFM log.

    Are you certain that you have checked the correct output?

    To disable TFM logging, you can set "CONFIG_TFM_LOG_LEVEL_SILENCE=y".

     

    Can you share your build/app-name/zephyr/zephyr.dts and .config file?

     

    Kind regards,

    Håkon 

  • Thanks for the Reply Hakon,

    1) I want to see NRF log into RTT in my cutom pcb? So, I have added config macros for RTT log in prj.conf file which I have mention earlier. I have alredy tried but I can't able to see the log over RTT viewer. So, How I can see RTT log on my PCB?

    2) Another option to saw log using printk, printk default used Uart0 pin ( Tx->29 & Rx->28 ). So, If I add my custom cellular_telemetric_devise.overlay file for change Uart0 default pin to my custom pcb debug log pin(Tx-> 1 & Rx-> 0). Is it possible to saw printk log on that  Pin number 1 and 0?. 

    Find attached below,

    7120.zephyr.dts

    PM_TFM_OFFSET=0x0
    PM_TFM_ADDRESS=0x0
    PM_TFM_END_ADDRESS=0x8000
    PM_TFM_SIZE=0x8000
    PM_TFM_NAME=tfm
    PM_TFM_ID=0
    PM_tfm_ID=PM_TFM_ID
    PM_tfm_IS_ENABLED=1
    PM_0_LABEL=TFM
    PM_TFM_SECURE_OFFSET=0x0
    PM_TFM_SECURE_ADDRESS=0x0
    PM_TFM_SECURE_END_ADDRESS=0x8000
    PM_TFM_SECURE_SIZE=0x8000
    PM_TFM_SECURE_NAME=tfm_secure
    PM_TFM_SECURE_ID=1
    PM_tfm_secure_ID=PM_TFM_SECURE_ID
    PM_tfm_secure_IS_ENABLED=1
    PM_1_LABEL=TFM_SECURE
    PM_TFM_SECURE_SPAN="tfm"
    PM_APP_OFFSET=0x8000
    PM_APP_ADDRESS=0x8000
    PM_APP_END_ADDRESS=0x100000
    PM_APP_SIZE=0xf8000
    PM_APP_NAME=app
    PM_APP_ID=2
    PM_app_ID=PM_APP_ID
    PM_app_IS_ENABLED=1
    PM_2_LABEL=APP
    PM_TFM_NONSECURE_OFFSET=0x8000
    PM_TFM_NONSECURE_ADDRESS=0x8000
    PM_TFM_NONSECURE_END_ADDRESS=0x100000
    PM_TFM_NONSECURE_SIZE=0xf8000
    PM_TFM_NONSECURE_NAME=tfm_nonsecure
    PM_TFM_NONSECURE_ID=3
    PM_tfm_nonsecure_ID=PM_TFM_NONSECURE_ID
    PM_tfm_nonsecure_IS_ENABLED=1
    PM_3_LABEL=TFM_NONSECURE
    PM_TFM_NONSECURE_SPAN="app"
    PM_OTP_OFFSET=0x0
    PM_OTP_ADDRESS=0xff8108
    PM_OTP_END_ADDRESS=0xff83fc
    PM_OTP_SIZE=0x2f4
    PM_OTP_NAME=otp
    PM_SRAM_SECURE_OFFSET=0x0
    PM_SRAM_SECURE_ADDRESS=0x20000000
    PM_SRAM_SECURE_END_ADDRESS=0x20008000
    PM_SRAM_SECURE_SIZE=0x8000
    PM_SRAM_SECURE_NAME=sram_secure
    PM_SRAM_SECURE_SPAN="tfm_sram"
    PM_TFM_SRAM_OFFSET=0x0
    PM_TFM_SRAM_ADDRESS=0x20000000
    PM_TFM_SRAM_END_ADDRESS=0x20008000
    PM_TFM_SRAM_SIZE=0x8000
    PM_TFM_SRAM_NAME=tfm_sram
    PM_NRF_MODEM_LIB_CTRL_OFFSET=0x8000
    PM_NRF_MODEM_LIB_CTRL_ADDRESS=0x20008000
    PM_NRF_MODEM_LIB_CTRL_END_ADDRESS=0x200084e8
    PM_NRF_MODEM_LIB_CTRL_SIZE=0x4e8
    PM_NRF_MODEM_LIB_CTRL_NAME=nrf_modem_lib_ctrl
    PM_NRF_MODEM_LIB_SRAM_OFFSET=0x8000
    PM_NRF_MODEM_LIB_SRAM_ADDRESS=0x20008000
    PM_NRF_MODEM_LIB_SRAM_END_ADDRESS=0x2000c568
    PM_NRF_MODEM_LIB_SRAM_SIZE=0x4568
    PM_NRF_MODEM_LIB_SRAM_NAME=nrf_modem_lib_sram
    PM_NRF_MODEM_LIB_SRAM_SPAN="nrf_modem_lib_ctrl nrf_modem_lib_tx nrf_modem_lib_rx"
    PM_SRAM_NONSECURE_OFFSET=0x8000
    PM_SRAM_NONSECURE_ADDRESS=0x20008000
    PM_SRAM_NONSECURE_END_ADDRESS=0x20040000
    PM_SRAM_NONSECURE_SIZE=0x38000
    PM_SRAM_NONSECURE_NAME=sram_nonsecure
    PM_SRAM_NONSECURE_SPAN="sram_primary nrf_modem_lib_ctrl nrf_modem_lib_tx nrf_modem_lib_rx"
    PM_NRF_MODEM_LIB_TX_OFFSET=0x84e8
    PM_NRF_MODEM_LIB_TX_ADDRESS=0x200084e8
    PM_NRF_MODEM_LIB_TX_END_ADDRESS=0x2000a568
    PM_NRF_MODEM_LIB_TX_SIZE=0x2080
    PM_NRF_MODEM_LIB_TX_NAME=nrf_modem_lib_tx
    PM_NRF_MODEM_LIB_RX_OFFSET=0xa568
    PM_NRF_MODEM_LIB_RX_ADDRESS=0x2000a568
    PM_NRF_MODEM_LIB_RX_END_ADDRESS=0x2000c568
    PM_NRF_MODEM_LIB_RX_SIZE=0x2000
    PM_NRF_MODEM_LIB_RX_NAME=nrf_modem_lib_rx
    PM_SRAM_PRIMARY_OFFSET=0xc568
    PM_SRAM_PRIMARY_ADDRESS=0x2000c568
    PM_SRAM_PRIMARY_END_ADDRESS=0x20040000
    PM_SRAM_PRIMARY_SIZE=0x33a98
    PM_SRAM_PRIMARY_NAME=sram_primary
    PM_NUM=4
    PM_ALL_BY_SIZE="otp nrf_modem_lib_ctrl nrf_modem_lib_rx nrf_modem_lib_tx nrf_modem_lib_sram tfm tfm_sram sram_secure tfm_secure sram_primary sram_nonsecure app tfm_nonsecure"

     

  • Hi,

     

    Thank you for sharing the .dts file.

    You are trying to redefine the pinctrl entires, but you are reusing the same name. However, this is only possible if you follow the exact same setup as the original definition.

    I would rather recommend that you rename your uart0_default and uart1_default to for instance "my_uart0_default" / "my_uart1_default".

    Something like this:

    ...
    
    
    &uart0 {
        compatible = "nordic,nrf-uarte";
        current-speed = <115200>;
        status = "okay";
        hw-flow-control;
    
        pinctrl-0 = <&my_uart0_default>;
        pinctrl-1 = <&my_uart0_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    &uart1 {
        compatible = "nordic,nrf-uarte";
        current-speed = <115200>;
        status = "okay";
        hw-flow-control;
    
        pinctrl-0 = <&my_uart1_default>;
        pinctrl-1 = <&my_uart1_sleep>;
        pinctrl-names = "default", "sleep";
    };
    
    
    &pinctrl {
    
        // Communication uart0
    	my_uart0_default: my_uart0_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 29)>,
    				<NRF_PSEL(UART_RX, 0, 28)>;
    		};
    	};
    
    	my_uart0_sleep: my_uart0_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 29)>,
    				<NRF_PSEL(UART_RX, 0, 28)>;
    			low-power-enable;
    		};
    	};
        my_uart1_default: my_uart1_default
        {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 1)>,
                    <NRF_PSEL(UART_RX, 0, 0)>;
            };
        };
    
        my_uart1_sleep: my_uart1_sleep
        {
            group1 {
                psels = <NRF_PSEL(UART_TX, 0, 1)>,
                        <NRF_PSEL(UART_RX, 0, 0)>;
                low-power-enable;
            };
        };
    };
    

     

    Could you try this and see if it works as expected now?

     

    Kind regards,

    Håkon

Related