This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

peripheral_uart, how to separate console and communication ?

Hi,

I work with win10 laptop, Toolchain  nrf Connect SDK 1.6.1 on a nrf5340dk.

I like to use the uart1 for the console (printk debugging) and the uart0 for communication.

In prj.conf I add "CONFIG_NRFX_UARTE1=y".

And in nrf5340_cpuapp_common.dts (in board folder) I change uart0 by uart1

" chosen {
        zephyr,console = &uart1;   //&uart0;
        zephyr,shell-uart = &uart0;
        zephyr,uart-mcumgr = &uart0;
        zephyr,bt-mon-uart = &uart0;
        zephyr,bt-c2h-uart = &uart0;
    }; "

But  nothing works, Leds are not blinking no more,

I can not see anymore the bluetooth module on the App nRF Connect,

and nothing on the serial terminal.

Could you help me please ?

Best Regards,

Rob.

Parents
  • Hi,

    In most cases I recommend using an overlay file instead of editing the board files.

    In the overlay file you should set the console to uart1, enable uart1, reconfigure the uart1 pins, and disable i2c1 as it conflicts with uart1:

    / {
        chosen {
            zephyr,console = &uart1;
        };
    };
    
    &uart1 {
        status = "okay";
        tx-pin = <35>;
    	rx-pin = <34>;
    };
    
    &i2c1 {
    	status = "disabled";
    };

    The default uart1 pins can not be used, as they are by default used by the network core.

  • Hi,

    Thank you for your answer.

    I try to make the modification on the prj.overlay file:

    I add CONFIG_NRFX_UARTE1=y in the prj.conf file:

    and in the main.c file I make a function to use the uart:

    I would like to send to the uart "01234" and send to the uart1 the printk "service",

    but I send on the uart 0 "service" and "01234".

    What should be done to separate sending of the Tx on uart0 and the printk on uart1 ?

    Best Regards,

    Rob

Reply
  • Hi,

    Thank you for your answer.

    I try to make the modification on the prj.overlay file:

    I add CONFIG_NRFX_UARTE1=y in the prj.conf file:

    and in the main.c file I make a function to use the uart:

    I would like to send to the uart "01234" and send to the uart1 the printk "service",

    but I send on the uart 0 "service" and "01234".

    What should be done to separate sending of the Tx on uart0 and the printk on uart1 ?

    Best Regards,

    Rob

Children
Related