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

How can I implement logging in mesh light switch example

Hi,

I am using 2 nRF52840 DK to build a network, One is the client and the other one is the server. Both of them are connected to computer with USB cable.

I would like to print to terminal (putty, tera term, termite) the messages what the boards are get or sent when a button is pushed.

which files have to be imported into project, which configuration have to be modified in configuration files, and with which function can I print to the terminal screen?

I am really newbie so please explain it step-by-step.

Best Regards,

Jonathan

Parents
  • Hi Jonathan,

    When I was running the mesh example some week ago, I managed to print out information, by using printf, to the terminal. In order to get the prints in the terminal it was only required to add some printfs in the code and then run JlinkExe;

    1. Install  J-Link Software and Documentation Pack
    2. Open up a terminal
    3. The first board run in terminal

      JLinkExe -device NRF52 -speed 4000 -if SWD and after Connect 

    4. Open a second terminal and write JLinkRTTClient
    5. As for the second board open up another terminal and write now

      JLinkExe -device NRF52 -speed 4000 -if SWD -SelectEmuBySN WRITE-SN-HERE(Can be found on the dev kit) -rtttelnetport 9999 and after Connect

    6. Now open up another terminal and write JLinkRTTClient -rtttelnetport 9999

    The explanation to first command is to set up a server where the terminal will listen to and the other one is the client where the prints will appear, so you should get the prints in the JLinkRTTClient if everything works correctly.

    Hope it helps!

Reply
  • Hi Jonathan,

    When I was running the mesh example some week ago, I managed to print out information, by using printf, to the terminal. In order to get the prints in the terminal it was only required to add some printfs in the code and then run JlinkExe;

    1. Install  J-Link Software and Documentation Pack
    2. Open up a terminal
    3. The first board run in terminal

      JLinkExe -device NRF52 -speed 4000 -if SWD and after Connect 

    4. Open a second terminal and write JLinkRTTClient
    5. As for the second board open up another terminal and write now

      JLinkExe -device NRF52 -speed 4000 -if SWD -SelectEmuBySN WRITE-SN-HERE(Can be found on the dev kit) -rtttelnetport 9999 and after Connect

    6. Now open up another terminal and write JLinkRTTClient -rtttelnetport 9999

    The explanation to first command is to set up a server where the terminal will listen to and the other one is the client where the prints will appear, so you should get the prints in the JLinkRTTClient if everything works correctly.

    Hope it helps!

Children
No Data
Related