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.
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.
This reply is written as the summary of the long discussion between JC, Q&A initiator, and me, the support guy; just so future reader can quickly know what we found out and what fixed things.
In this answer, UART peripherals are referred to using the label they defined in nrf5340_cpuapp_peripherals.dtsi.
The issue is that JC, starting from the peripheral_lbs, reconfigure an AppCore UART TX to P1.01 using .overlay file.
The reason there was no UART output is not related to CONFIG_BT=y, but rather the pin P1.01 was used.
By default, nrf5340_cpuapp_common.dts files and its related .dts/.dtsi give the P1.01 pin to NetCore to use with another UART peripheral.
P1.00, P0.11, P0.10 are affected similarly.
Therefore in the .overlay file, the nrf-gpio-forwarder also has to be disabled.
Note that this also disable the UART peripheral in the NetCore.
If UART is also necessary in the NetCore, then NetCore also need its own overlay/custom dts setup, and AppCore nrf-gpio-forwarder should not be disabled but update accordingly.
The complete .overlay solution is below:
/ { gpio_fwd: nrf-gpio-forwarder { compatible = "nordic,nrf-gpio-forwarder"; status = "disabled"; uart { gpios = <&gpio1 1 0>, <&gpio1 0 0>, <&gpio0 11 0>, <&gpio0 10 0>; }; }; }; &pinctrl { custom_default: c { group1 { psels = <NRF_PSEL(UART_TX, 1, 1)>; }; group2 { psels = <NRF_PSEL(UART_RX, 0, 29)>; bias-pull-up; }; }; custom_sleep: custom_sleep { group1 { psels = <NRF_PSEL(UART_TX, 1, 1)>, <NRF_PSEL(UART_RX, 0, 29)>; low-power-enable; }; }; }; &uart0 { status = "okay"; current-speed = <115200>; pinctrl-0 = <&custom_default>; pinctrl-1 = <&custom_sleep>; pinctrl-names = "default", "sleep"; };
Thank you very much for helping
Thank you very much for helping