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

RTT Logging not working when building with ARM GCC

Hi,

I'm trying to use RTT Logging in my application. If I build and flash my application through Segger Embedded Studio RTT logging works. However If I use ARM GCC to build the application and nrfjprog to flash RTT logging does not work. 

NRF_LOG and BACKEND_RTT is enabled in my sdk_config.h and I'm doing the following calls in main:

APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
NRF_LOG_DEFAULT_BACKENDS_INIT();


For ARM GCC I'm using the generic linker file inside the SDK folder config/nrf52840/generic_gcc_nrf52.ld, with a slight modification to the RAM_START and RAM_SIZE to allow for multiple connections. 

Are there any more modifications that needs to be done in order to enable RTT Logging when using ARM GCC? 

As a side note: UART Backend logging works without any issues when I build with ARM GCC

board: nRF52840 Preview DK

SDK: v15

Softdevice: 6.0.0

Br,
Anton

Parents Reply Children
  • OK, I see. So probably there is not enough available RAM for the RTT buffer? But then I would have expected you to see a linker error. Does the map file tell you anything useful?

  • 8132.nrf52840_xxaa.map
    I've tried to look through, although I'm not quite sure what do look for. I have uploaded the file in my answer. Perhaps you can see something?

  • Here is the part relating to Segger RTT

     .text.SEGGER_RTT_ReadNoLock
                    0x0000000000000000      0x100 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_Read
                    0x0000000000000000      0x110 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_WriteWithOverwriteNoLock
                    0x0000000000000000       0xe8 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_WriteSkipNoLock
                    0x0000000000000000       0xa0 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_Write
                    0x0000000000000000      0x1f4 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_WriteString
                    0x0000000000000000      0x1f8 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_PutCharSkipNoLock
                    0x0000000000000000       0x40 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_PutCharSkip
                    0x0000000000000000       0xb8 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_PutChar
                    0x0000000000000000       0xd4 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_GetKey
                    0x0000000000000000      0x104 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_WaitKey
                    0x0000000000000000      0x124 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_HasKey
                    0x0000000000000000       0x6c _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_HasData
                    0x0000000000000000       0x18 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_AllocDownBuffer
                    0x0000000000000000       0xc4 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_AllocUpBuffer
                    0x0000000000000000       0xcc _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_ConfigUpBuffer
                    0x0000000000000000       0xdc _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_ConfigDownBuffer
                    0x0000000000000000       0xbc _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_SetNameUpBuffer
                    0x0000000000000000       0x98 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_SetNameDownBuffer
                    0x0000000000000000       0x98 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_SetFlagsUpBuffer
                    0x0000000000000000       0x98 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_SetFlagsDownBuffer
                    0x0000000000000000       0x98 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_SetTerminal
                    0x0000000000000000      0x160 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .text.SEGGER_RTT_TerminalOut
                    0x0000000000000000      0x408 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .bss._ActiveTerminal
                    0x0000000000000000        0x1 _build/nrf52840_xxaa/SEGGER_RTT.c.o
     .rodata._aTerminalId
                    0x0000000000000000       0x10 _build/nrf52840_xxaa/SEGGER_RTT.c.o

  • Hi,

    I have no explanation at this point, and I do not recall ever seeing this issue earlier. A few additional questions:

    • Can you confirm that  you use JLinkRTTViewer.exe to view the logs?
    • Does it have any effect if you disable UART logging (so that you only have RTT logging enabled)?
    • How have you configured the RTT viewer? It should look similar to this:

     

  • Hi,

    • Can you confirm that  you use JLinkRTTViewer.exe to view the logs? No, I'm on Linux so I use JLinkExe and JLinkRTTClient to view the logs. When connecting using JLinkExe I use SWD as the interface
    • Does it have any effect if you disable UART logging (so that you only have RTT logging enabled)? No, I have disabled UART Logging but still no RTT Logs
    • How have you configured the RTT viewer? When using JLinkExe the only option I select is SWD as the interface and then default the rest of selection. This configuration has worked previously.
Related