Hi
I want to use loggers in the program. I understand that the code itself uses NRF_LOG. But I do not understand where those log details are printed. So, how do I create custom logs and save to some file?
Thanks in advance.
Hi
I want to use loggers in the program. I understand that the code itself uses NRF_LOG. But I do not understand where those log details are printed. So, how do I create custom logs and save to some file?
Thanks in advance.
Hello,
That depends on what the backend for the log is set to. Search for "NRF_LOG_BACKEND" in sdk_config.h. There are two possible defines there. UART or RTT, and they are set to either 0 or 1. Which one is set to 1?
If it is UART, it should be printed over the UART, which is picked up by the programming chip on the DK, and you can view it using e.g. Termite, or Putty.
If it is RTT, then you can use JLink RTT Viewer.
If it is RTT and you are using Segger Embedded Studio, then you can view the log while you are debugging in your IDE.
If you can't find any Backend defines in sdk_config.h, what project/examples are you using?
Best regards,
Edvin
Hi,
In the sdk_config.h file, UART value is set to 1, which means that I can use putty to view the log files, right? How to do that? Do I need to connect TX and RX pins or something like that? I have DK connected to the system(Linux) via USB.
Thanks,
Sai Kiran
Hi,
In the sdk_config.h file, UART value is set to 1, which means that I can use putty to view the log files, right? How to do that? Do I need to connect TX and RX pins or something like that? I have DK connected to the system(Linux) via USB.
Thanks,
Sai Kiran
Hello,
By default, if the UART is set as log backend, they use pins 6 and 8. These pins are connected to the pinout, so you can use an external UART module, but they are also connected to the Segger chip on board the DK, so you should be able to use the COM port connected via the USB on the DK to monitor the UART output.
The terminal settings should be like it is described in point 2 here.
So no, you don't need to connect the TX and RX pins to anything as long as you don't change the pin numbers, 6 and 8 (but that is an option as well).
Best regards,
Edvin
Hi
Thanks for the reply. I tried doing whatever you told, using Putty. Here is the screenshot of the same.
When I try to connect, the following error comes up.
Hello,
I am not a linux expert, but are you sure that it is the correct serial port? Or maybe you have the serial port open in another application?
Otherwise the settings looks correct (well, I only see the baudrate).
You don't happen to have a windows computer? Termite is quite easy to set up. It suggests port and the settings that are mentioned in the link that I sent you. Just to see that the DK is actually responding.
Best regards,
Edvin
I am trying to check if the serial port is correct. Still working on it. I will try on a Windows computer as well.
Thanks,
Sai Kiran.
Hi,
I just used Putty to do the same thing, but this time in the Serial Line I put "/dev/ttyACM0". It's working. If I want to save these logs into a file, what should I do?
Thanks,
Sai Kiran.