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

unable to use RTT in nrf91

Hi all,

I'm trying to get the Thingy device work with (SEGGER's) RTT.
I used the asset_tracker sample application and edited it to just print to RTT in a loop after all inits.
Sadly, printing to RTT never outputs anything on the RTT Client.

I've already tried to use the RTT module built in zephyr:
I added this to the prj conf:
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
CONFIG_PRINTK=y
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_UART_CONSOLE=n
CONFIG_USE_SEGGER_RTT=y
CONFIG_RTT_CONSOLE=y

Also I tried to just download add the SEGGER RTT files by my own. same result.

this is the code i added to main.c:

//function outside main:
static void _Delay(int period) {
int i = 100000*period;
do { ; } while (i--);
}

// inside main:
do {
printk("\n\n\t\tALM\n\n\n");
SEGGER_RTT_WriteString(0, "Hello World from SEGGER!\r\n");
_Delay(100);
} while (1);
return 0;

To receive RTT msgs i used JlinkExe (connected), and JLinkRTTClient.

Please help me understand why I don't get any output.
Thanks.

Parents
  • I was able to make it work, I did the following:

    • Connected the Thingy:91 to an nRF91 DK using a cable like this
    • Modified ncs\zephyr\samples\hello_world:
      • Added include($ENV{ZEPHYR_BASE}/../nrf/cmake/boilerplate.cmake) to CMakeLists.txt
      • Added these configurations to prj.conf:

    CONFIG_UART_CONSOLE=n
    CONFIG_RTT_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y

    • Then I programmed and flashed the Thingy trough the 91 DK debugger
    • Opened J-Link RTT Viewer:

    It worked (I put the log in a while(true) loop with a delay)

    It is important to not disconnect the 10-pin cable that goes between the Thingy:91 and the 91 DK, since the RTT logging goes through this

    Best regards,

    Simon

Reply
  • I was able to make it work, I did the following:

    • Connected the Thingy:91 to an nRF91 DK using a cable like this
    • Modified ncs\zephyr\samples\hello_world:
      • Added include($ENV{ZEPHYR_BASE}/../nrf/cmake/boilerplate.cmake) to CMakeLists.txt
      • Added these configurations to prj.conf:

    CONFIG_UART_CONSOLE=n
    CONFIG_RTT_CONSOLE=y
    CONFIG_USE_SEGGER_RTT=y

    • Then I programmed and flashed the Thingy trough the 91 DK debugger
    • Opened J-Link RTT Viewer:

    It worked (I put the log in a while(true) loop with a delay)

    It is important to not disconnect the 10-pin cable that goes between the Thingy:91 and the 91 DK, since the RTT logging goes through this

    Best regards,

    Simon

Children
Related