Hello,
I am trying to compile a basic Hello World application for a custom PCB with a nRF52832 microcontroller. I am using VS Code and the nRF Connect SDK. I have completed the nRF Connect SDK Fundamentals course and received the certificate, and now I am trying to apply those lessons to my custom hardware.
My goal is to compile a Hello World example and see the message printed on the VS Code console. My custom hardware does not have a UART connection broken out. I am programming my custom hardware over SWD via a nRF52-DK PCA10040 board. I would like to receive logging messages over SWD as well.
When I connect a TagConnect cable to the P19 Debug Out connector and mate it with my custom board, I can see the Connected Devices tab update from NRF52832_xxAA_REV2 to NRF52832_xxAB_REV2, so I am fairly sure that I am programming my custom board and not the DK itself.
Initially, I tried a simple printk statement, which builds and runs, but no messages are received in the terminal. After some digging in the Nordic forums, I realized that I want to use the SWD interface for console output, instead of a UART. So, I enabled logging as explained in the Fundamentals course Lesson 4 Exercise 2. I also tried changing my prj.conf to disable the UART console and enable the RTT_CONSOLE instead.
This builds and flashes without issue, but I am still not getting any of my debug messages.
How can I properly set up the SWD interface for Hello world, printk, and logging messages on a custom PCB?
main.c
prj.conf
CMakeLists.txt
Custom PCB board defconfig
Custom board DTS file
Custom PCB board.cmake