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
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.
Hi,
There was logging option available in putty GUI on linux also. I should have checked before asking. My bad.
Excuse me for that.
Thanks,
Sai Kiran.
Hi,
There was logging option available in putty GUI on linux also. I should have checked before asking. My bad.
Excuse me for that.
Thanks,
Sai Kiran.
Yes. That is the UART terminal that you need to use. The nRF doesn't have access to your file system on your computer It will only log using either UART or RTT.
But you figured it out? Are you able to log to your file?
Best regards,
Edvin
Yes. Saving to a file option is available in Putty. Here's how I did it.
Thanks,
Sai Kiran.