Using printk on custom board nRF Connect SDK

Hello.
I have a custom board featuring nRF5340. I have a programming interface that i connect to the DK in order to program it, using SWDIO, SWDCLK and RESET. In addition, I have a micro USB port set exactly like the on in the DK.

Given that, how do I make printk work? I would prefer to print via the dev-kit that i can connect to, and eventually send other data via uart_fifo_fill with USB.

What are the settings that I need in the devicetree?

Parents
  • Hi Dario,

    Could you elaborate what you meant by "print via the dev-kit that I connect to" . How do you connect your board to the devkit ? Via GPIO or via SWD interface ? 
    You can use the DK UART by connecting the UART pins of the custom board to the UART pin of the nRF5340 on the DK. If you don't flash anything on the nRF5340 DK you can overwrite the nRF5340 on the DK and transmit your UART data via the interface chip on the DK. 

    If you simply want printk to be routed to RTT. You can try the example I attached here. It works on the DK configuration, so I'm don't know if it work with your board dts configuration or not. 

    button_RTT.zip

    If you want to output to the onboard USB interface, you may want to look at the thingy53 samples that it output the log via USB. Check the peripheral_uart sample. It has both RTT and USB (UART) log. 

Reply
  • Hi Dario,

    Could you elaborate what you meant by "print via the dev-kit that I connect to" . How do you connect your board to the devkit ? Via GPIO or via SWD interface ? 
    You can use the DK UART by connecting the UART pins of the custom board to the UART pin of the nRF5340 on the DK. If you don't flash anything on the nRF5340 DK you can overwrite the nRF5340 on the DK and transmit your UART data via the interface chip on the DK. 

    If you simply want printk to be routed to RTT. You can try the example I attached here. It works on the DK configuration, so I'm don't know if it work with your board dts configuration or not. 

    button_RTT.zip

    If you want to output to the onboard USB interface, you may want to look at the thingy53 samples that it output the log via USB. Check the peripheral_uart sample. It has both RTT and USB (UART) log. 

Children
No Data
Related