This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf5340 USB Terminal

Hi,

Do you have an example of how to implement a serial console with nrf connect 1.4.99-dev1 with nrf5340_REV1, I tried compiling usb_uart_bridge but got following error.

devicetree error: 'tx-pin' is marked as required in 'properties:' in C:/Users/Timo/ncs/v1.4.99-dev1/zephyr/dts/bindings\serial\nordic,nrf-uarte.yaml, but does not appear in <Node /soc/peripheral@50000000/uart@9000 in 'nrf5340dk_nrf5340_cpuapp.dts.pre.tmp'>

  • The usb_uart_bridge is not meant to be used with the nRF5340, as you can see in the USB-UART bridge Requirements. The serial logging should work out of the box with the nRF53 PDK. The UART0 instance should be connected to the Interface MCU, which converts it to USB.

    Try the following:

    • cd into zephyr/samples/hello_world
    • Connect the nRF53 PDK to your PC, and open a Termite terminal
    • Run west build -b nrf5340pdk_nrf5340_cpuapp && cd build && west flash

    Best regards,

    Simon

  • PDK works fine but we have a custom board with nrf5340 REV1.

    We can get the device to show up as a virtual serial port in Windows device manager but none of the messages we print inside the firmware show up the console.

  • How have you wired the board? What UART instance are you using for logging? What GPIOs are you using for TX and RX? What are the TX and RX pins connected to, a uart to usb converter, an interface MCU?

    In the nRF5340 DK by default, uart0 is used for logging where TX and RX are equal to respectively 20 and 22. If you have copied this board folder, make sure these pins are wired correctly.

    Best regards,

    Simon

  • We are using the USB-peripheral inside the nrf5340

    D+ From Pin B2 and
    B- From pin B4

    We enabled the USB Console option from the Nrf Connect which causes the device to appear as a virtual serial port in windows device manager. But none of the printk or printf messages produce any output on the serial console, is there an extra option we have to enable to make it work.

  • If you want to log data with the the USB peripheral instead of the UART peripheral, the USB CDC ACM sample may be a nice starting point.

    Best regards,

    Simon

1 2