No output to UART console when CONFIG_BT=y

There is no output to UART console when I set CONFIG_BT=y in prj.conf

peripheral_lbs sample project in ncs V2.0.2 can't printk anything.  

Parents
  • Hi,

    Unfortunately I cannot reproduce your issue.
    I just now tried a brand new application based on the NCS v2.0.2 peripheral_lbs example on both the nRF52DK and the nRF5340DK, and for both printk() worked and I got data on a Serial Port.
    I really don't think CONFIG_BT=y would break UART console, that would really not make sense.

    Are you developing on a Development Kit or on your custom board?

    By the way, as you requested, the prj.conf used to test:

    #
    # Copyright (c) 2018 Nordic Semiconductor
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="Nordic_LBS"
    
    # Enable the LBS service
    CONFIG_BT_LBS=y
    CONFIG_BT_LBS_POLL_BUTTON=y
    CONFIG_DK_LIBRARY=y
    
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    

    Best regards,
    Hieu

  • Hello Hieu, 

    Thanks for your quick response.  I have one more request.  Would you use the nrf5340dk_nrf5340_cpuapp.overlay    file to disable to UART console and see if you can still receive output.?  My problem seems to be complicated.  The UART on nRF5340DK always work even if I intentionally disable the UART or assign different TX and RX pins.   I am trying to make sure the overlay file can change the behavior first, then I will make correct adjustment on my own custom board. 

    I have more problem on my custom board, but one thing at a time.  I want to get the UART working in different configuration/overlay first.

    Thanks again.

    My own. nrf5340dk_nrf5340_cpuapp.overlay. for a different custom board, but nRF5340DK is unexpectly working fine with it, so something is wrong

    I may have mistakes in the overlay file


    &uart0 {
        //status = "okay";
        status = "disabled";
    	label = "UART_0";
    	current-speed = <115200>;		// 115200
        pinctrl-0 = <&uart0_default_alt>;
        pinctrl-1 = <&uart0_sleep_alt>;
        pinctrl-names = "default", "sleep";
    };
    
    
    &pinctrl {
        uart0_default_alt: uart0_default_alt {
            group1 {
                psels = <NRF_PSEL(UART_TX, 1, 1)>;		// P1.1 is TX
            };
            group2 {
                psels = <NRF_PSEL(UART_RX, 0, 29)>;		// P0.29 is RX
                bias-pull-up;
            };
        };
        uart0_sleep_alt: uart0_sleep_alt {
            group1 {
                psels = <NRF_PSEL(UART_TX, 1, 1)>,		// P1.1 is TX
                        <NRF_PSEL(UART_RX, 0, 29)>;		// P0.29 is RX
                low-power-enable;
            };
        };
    };
    

  • 1. UART0 with TX on P1.01, RX on P1.00 (VCOM0/UART1 ports). Not disabling GPIO forwarde

    You should observed only bootloader logging on a different COM port.

    That is VCOM0.

    I got same output as case 0.

  • 2. UART0 with TX on P1.01, RX on P1.00 (VCOM0/UART1 ports). Disabling GPIO forwarder.

    You should observed both bootloader and application logging on VCOM0


    I did not the uart output from the NetCore now, so I think the UART output from NetCore is not forwarded

  • 3. UART0 with TX on P1.01, RX on P0.29 (your configuration). Disabling GPIO forwarder.

    You should observed both bootloader and application logging on VCOM0.

    Now I got the AppCore UART output on the right terminal.  Disable the GPIO forwarder is the secret.

  • 4. UART0 with TX on P1.01, RX on P0.29 (your configuration). NOT disabling GPIO forwarder.

    You should observed only bootloader logging on VCOM0.

    Now I have the UART output of the NetCore only.

  • Hello Hieu,

    Using the configuration #3 with the gpio forwarder disabled, I am able to make my custom board works as intended.   It was enabled in the default configuration, so UART of NetCore was forwarded to the UART pins for the AppCore.  Now it is all cleared.  Thanks for your help.  You may close this case.

Reply Children
  • Hi JC,

    Sorry about the confusion with Step 4. I should have mentioned it in the experiment step. Step 4 indeed is intended as a degrading step to show you that not disabling the GPIO forwarder will cause problem with getting P1.01 to work.

    It is also surprising to me how you have different observation compared to my expected one. I did verify each of the steps at least two times each... I will get hold of a v1.0.0 nRF5340 DK and look into if I missed anything.
    Edit*: I think the reason you observe different result for Step 0, 1, and 2 is because you have a custom NetCore application on. Going to verify later.

    I am glad you are where you want to be. I will then post the Step 3 overlay code as a separated reply and suggest it as an answer. If you find everything correct, please verify it. Or I can also verify it on my own a few days later.

    Regarding the items below that I promised to provide and you showed interest in, do you still want it? It looks like you have an even better grasp on setting up NetCore than I do now, so I won't be surprised if you figure out how to disable UART on NetCore before I do, if you haven't already known.

    I will still look into these items nonetheless because I need the knowledge. I guess either way I can post a follow up reply here somewhere so people can see in the future.

    jchan12345 said:

    1. - More accurate information on the relations between the bootloader and the .overlay file
    2. - How to ensure NetCore is not using the UART peripheral, or at least P1.01 which you need.
    3. - The answer to your latest question, about the warning of Kconfig being reassigned.

    Question 2 is the most important for me.

    Question 3 is related to setting CONFIG_SERIAL=n in child_image\hci_rpmsg.   It is not happy and gives out warning when NetCore UART is being shutdown by CONFIG_SERIAL=n, so it is not freely reconfigurable?  Does it has to be always on and come out at the default pins for UART0, ...etc ??

    Best regards,

    Hieu

Related