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.
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.
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
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
Hello Hieu,
Found the following code in nrf5340_cpunet_reset.c of ncs v1.9.1. Does disabling gpio forwarder in overlay file work with v1.9.1. ?? Thanks,
JC
static void remoteproc_mgr_config(void) { #if !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM) /* UARTE */ /* Assign specific GPIOs that will be used to get UARTE from * nRF5340 Network MCU. */ soc_secure_gpio_pin_mcu_select(CPUNET_UARTE_PIN_TX, NRF_GPIO_PIN_MCUSEL_NETWORK); soc_secure_gpio_pin_mcu_select(CPUNET_UARTE_PIN_RX, NRF_GPIO_PIN_MCUSEL_NETWORK); soc_secure_gpio_pin_mcu_select(CPUNET_UARTE_PIN_RTS, NRF_GPIO_PIN_MCUSEL_NETWORK); soc_secure_gpio_pin_mcu_select(CPUNET_UARTE_PIN_CTS, NRF_GPIO_PIN_MCUSEL_NETWORK); /* Route Bluetooth Controller Debug Pins */ DEBUG_SETUP(); #endif /* !defined(CONFIG_TRUSTED_EXECUTION_NONSECURE) || defined(CONFIG_BUILD_WITH_TFM) */