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

    • RTT Telnet client ignores SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL



      I have an application based on RTT for transferring large amounts of data (2 or more orders of magnitude larger than the buffer size) from host to target. For this, I have written a Python script to open a telnet connection using telnetlib and send data with telnet.write().

      This functions correctly on J-Link version 6.32g. However, after upgrading to latest version (6.72d as of now), I am unable to successfully complete transfers. The first approximately 4k of data, which is the same amount as the down buffer size, arrive correctly. After this point, data is missing. Some blocks continue to arrive, but with gaps. It would seem that the SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL flag is ignored and the telnet client is dropping data that would overflow.

      If I split the payload into 1k chunks and add sleeps between telnet.write() calls, the transfer completes successfully.

      I also tested versions 6.64 and 6.70c with the same results.

      • Target: Cortex M4 based SoC.
      • OS: Linux 64-bit.
      • Debugger: J-Link Base.
      RTT Setup:
      • The RTT source files (SEGGER_RTT.c, SEGGER_RTT.h, etc.) have been updated to the code from the latest J-Link release.
      • The default channel 0 ("Terminal") is used.
      • Both up and down buffers have .Flags = 2 /* SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL */.
      • Connection to target is established by JLinkExe with SWD.
      • Some metadata messages are exchanged successfully between host and target before payload is sent.
      Any help would be appreciated, as I haven't been able to find the source of the issue.


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