[SOLVED] No output from RTT on Ubuntu 16.04, Eclipse Neon, GNU ARM plugin, nrf52dk

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

  • [SOLVED] No output from RTT on Ubuntu 16.04, Eclipse Neon, GNU ARM plugin, nrf52dk

    I have tried both a Telnet terminal in Eclipse, and RTT Viewer in a terminal outside Eclipse. Both seem to connect to localhost:19021 OK. I step through calls to SEGGER_RTT_Init and ....WriteString. They seem to know where the ring buffer is and write to an upBuffer. But nothing appears on the terminals.

    My model is that JLink should be polling the RTT control block using SWD (or JTAG?), and writing via USB and GDB client to localhost:19021 when it finds something changed. I suppose JLink is not finding the control block?

    More environment: NRF SDK v. 12, recent. Using RTT code from the <SDK>/external/seggert_rtt/. Also, using C++ compiler, but it seems to step through OK.

    I saw a post about "existing session" but I don't find that setting anywhere. Maybe I just need to start the pieces in the correct order?

    I have tried various settings in the Eclipse Debug Configuration, such as disable "Startup>Enable semihosting", and changing "Debugger>Telnet port" from 2333 to 19021 (probably wrong thing to do.)

    My app compiles and runs OK and I can use the Eclipse debugger OK, just no RTT output. I just need some output, so maybe I should try NRF_LOG (but I haven't been able to get it to work, I'm not sure why it would use a UART?) or maybe I should try semihosting/SWO?

    Later: I see that the debugger and RTT client must cooperate, and that the Windows version does have a "Connect existing session" option. I will try it without the debugger, and change the order I started them both.

    The post was edited 1 time, last by bootchk ().

  • I find that I can get RTT output via JLinkRTTClient to JLinkExe to dev board running my app. My question becomes: is RTT and debugging using JLinkGDBServer exclusive, or can you get RTT output while running GDB, say in Eclipse? If you can't do that, I suppose you can kill JLinkExe, and attach to the running app under test using JLinkGDBServer? In other words, is one way to debug: start by observing RTT output, and when you find something strange in the RTT log, break into the running app using GDB?

    Along the same line of questions, can you get SWO output while debugging in Eclipse using JLinkGDBServer?

    The post was edited 1 time, last by bootchk ().

  • Hi,

    My question becomes: is RTT and debugging using JLinkGDBServer exclusive, or can you get RTT output while running GDB, say in Eclipse?

    I am not sure if I understand you correctly: Eclipse has a GDB Client which connects to the J-Link GDB Server (which is the only GDB server which can communicate with a J-Link). Therefore GDB debugging with J-Link in general (regardless if RTT is used or not) is J-Link GDB Server "exclusive".

    Best regards,
    Niklas
    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.
  • I may have a mistaken model or be using the wrong terms. My model when using GDB is:

    GDB client <- socket? -> GDBServer <- USB -> probe <- SWD/JTAG -> target

    My model when using RTT is:

    JLinkRTTViewer <- socket -> JLinkExe <- USB -> probe <- SWD/JTAG -> target

    And my question is, can the GDB client (specifically using Eclipse) display RTT output while a debugging session is in progress?

    Or, can JLinkRTT connect to the GDBServer concurrently with a connection from GDBclient. This model:

    GDB client <- socket 23xx?-> GDBServer <- USB -> probe <- SWD/JTAG -> target
    JLinkRTTViewer <- socket 19021--^

    In other words, I use JLinkRTTViewer to watch the log, but when I see something abberant, must I quit JLinkRTTViewer and JLinkExe before I can start a debugging client?

    If so, is it a limitation of the particular toolchain (Eclipse, GDB) and that another toolchain might be better in this regard?
  • Hi,

    Eclipse <-> GDB <-> GDBServer <-> J-Link
    RTTViewer <-> J-Link
    can run in parallel.

    Also, if your Eclipse "virtual UART" etc. window is capable of opening a telnet connection (like PuTTY is), you can have RTT output directly in your Eclipse

    You can also have running a PuTTY session connecting to 19021, in parallel to your Eclipse + GDBServer session.


    - Alex
    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.
  • Yes, thanks, it DOES work as you described. (My apologies, I don't know why my initial attempts seemed not to work.)

    For interested readers: when you start RTTClient, it displays what process it connects to. If you start JLinkExe and not GDBServer, it displays:

    Source Code

    1. ###RTT Client: Connecting to J-Link RTT Server via localhost:19021 Connected.
    2. SEGGER J-Link V6.00i - Real time terminal output
    3. J-Link OB-SAM3U128-V2-NordicSemi compiled Sep 26 2016 11:30:32 V1.0, SN=682102069
    4. Process: JLinkExe


    If you start GDB on say Eclipse, RTTClient displays:

    Source Code

    1. ###RTT Client: Connecting to J-Link RTT Server via localhost:19021 Connected.
    2. SEGGER J-Link V6.00i - Real time terminal output
    3. J-Link OB-SAM3U128-V2-NordicSemi compiled Sep 26 2016 11:30:32 V1.0, SN=682102069
    4. Process: JLinkGDBServer