__jlinkExecCommand Usage for RTT RAM memory.

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • __jlinkExecCommand Usage for RTT RAM memory.

    Hello SEGEGR users and Administrators,

    I have a question on how to correctly use the __jlinkExecCommand with IAR Workbench to set location of the RAM buffer for RTT.


    I need to set the RTT address as it was pointed out in FAQ for RTT, but I am having difficulty locating manual pages for __jlinkExecCommand.
    After launching app in debugger and connecting to Jlink RTT Client I can set correct address in the Jlink Controll panel but
    by then the output is "stale" -- i.e. not exactly real-time.

    I think the __jlinkExecCommand ("SetRTTAddr 0x20000000") is the right answer but how do I get it compiled into the application? There may be
    even better way to accomplift this. Advice is very welcome.

    BTW would it be a good idea to set a standalone RTT section on this forum?

    Thanks!

    1/f

    ================================= from FAQ on RTT ===========================

    Q:I do not see any output, although the use of RTT in my application is correct. What can I do?A:
    In some cases J-Link cannot locate the RTT buffer in the known RAM region.
    In this case the possible region or the exact address can be set manually via a J-Link exec command:
    • Set ranges to be searched for RTT buffer: SetRTTSearchRanges <RangeStart [Hex]> <RangeSize >[, <Range1Start [Hex]> <Range1Size>, ...] (e.g. "SetRTTSearchRanges 0x10000000 0x1000, 0x2000000 0x1000")
    • Set address of the RTT buffer: SetRTTAddr <RTTBufferAddress [Hex]> (e.g. "SetRTTAddr 0x20000000")
    • Set address of the RTT buffer via J-Link Control Panel -> RTTerminal
    J-Link exec commands can be executed in most applications, for example in J-Link Commander via "exec <Command>", in J-Link GDB Server via "monitor exec <Command>" or in IAR EW via "__jlinkExecCommand("<Command>");" from a macro file.
  • Hello,
    After launching app in debugger and connecting to Jlink RTT Client I can set correct address in the Jlink Controll panel but

    by then the output is "stale" -- i.e. not exactly real-time.
    What target device are you using?
    RTT can only be used with targets which allows background memory access while running, which are Cortex-M devices.
    I think the __jlinkExecCommand ("SetRTTAddr 0x20000000") is the right answer but how do I get it compiled into the application? There may be

    even better way to accomplift this. Advice is very welcome.
    Yes, this is correct. The command has to be executed from an IAR macro file like this:

    Source Code

    1. /*********************************************************************
    2. *
    3. * Set_RTT_Address()
    4. * Select the RTT control block address to be used by J-Link
    5. */
    6. Set_RTT_Address() {
    7. __var addr;
    8. __var str;
    9. addr = &_SEGGER_RTT;
    10. str = __smessage "SetRTTAddr ",addr:%x;
    11. __jlinkExecCommand(str);
    12. __message "RTT Address: ",addr:%x,"\n";
    13. }
    14. /*********************************************************************
    15. *
    16. *
    17. execUserSetup()
    18. */
    19. execUserSetup() {
    20. __message "Macro file: execUserSetup()";
    21. Set_RTT_Address();
    22. }
    Display All


    The macro file can be set at Project -> Options... -> Debugger -> Tab Setup -> Setup macros

    Best regards
    Johannes
    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.