[SOLVED] JLink Commander / CLI does not find RTT block automatically?

  • [SOLVED] JLink Commander / CLI does not find RTT block automatically?

    Hi. I am using JLink on OSX, targeting an STM32L496AG micro.

    When connecting via command link JLinkExe, it seems like the RTT control block is not automatically found.

    Invocation is:
    JLinkExe -device STM32L496AG -if swd -speed auto -autoconnect 1

    While JLinkExe connects and controls the core OK without issue, it does not seem to make RTT output available to the JLinkRTTClient running in another shell.
    Is this expected behavior?

    However, when using Ozone for debugging, the RTT block is detected automatically upon connection, and all output appears through JLinkRTTClient.

    After some tinkering, the one workaround I found was to force a manual search, by putting this into an `rtt.jlink` file:
    h r exec SetRTTSearchRanges 0x20000000 0x50000

    And running:
    JLinkExe -device STM32L496AG -if swd -speed auto -autoconnect 1 -CommandFile rtt.jlink

    In this case, it does appear that RTT output is picked up and visible in the JLinkRTTClient.

    A minor note is that I see the RAM size listed for the STM32L496AG MCU in the Segger list is 256KB, whereas this part actually has 320KB of SRAM. Possibly an incorrect search is being done? Although I am not sure why that would work in Ozone and not CLI.
  • Hi,

    The answer to this is simple:
    1) When used from Ozone, J-Link does not search for the RTT block in memory. This is because Ozone searches the symbol table of the opened ELF file for the RTT control block. When found, it passes the symbol’s address to J-Link, so J-Link does not have to search memory.

    2) The RAM that is entered in the J-Link DLL is the work RAM used for flash programming. There is absolutely no guarantee that this work RAM reflects the complete RAM available on the device.

    We will check if RTT experience can be improved here. However, for now we recommend to specify the search range or link the control block to a fixed address and tell J-Link that address.
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.