[SOLVED] Sudden error with J-Link RTT Viewer: "WARNING: Sent 15 of 89 bytes."

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

  • [SOLVED] Sudden error with J-Link RTT Viewer: "WARNING: Sent 15 of 89 bytes."

    Hi,

    I am developing a program on a Nordic nRF51 DK, and am using J-Link RTT for a debug command line interface. This has worked very well for some time, but now I have a problem: When I type a command, the Log tab of the j-Link RTT Viewer opens and there is a message: "WARNING: Sent 15 of 89 bytes." The first number is always 15, and the second varies with the length of the command. Commands longer than 15 bytes gives this answer, commands shorter than 15 bytes seem to work.

    I am totally at loss. I realize that my own program is the major suspect, maybe an astray pointer. Possibly, there is some error with the RTT code from Segger/Nordic. Another thing is that my program now is now close to 64kB, and it might be some 16/32-bit address error. I have not configured RTT in any way, just called SEGGER_RTT_Init().



    I would like to know what causes this error in the RTT Viewer, so I can use this information to debug my code. Any help appreciated.

    regards,
    //Elm
  • Hi Elm,

    For input to the target the input buffer size has to be large enough for the input.

    The buffer size for channel 0 (which RTT Viewer sends to) can be configured in SEGGER_RTT_Conf.h

    The default for BUFFER_SIZE_DOWN is 16 bytes, which allows input of 15 bytes.
    Set it to your longest input command + 1.

    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.
  • Hi,

    This has worked before, this is what puzzles me.

    My command lines have different lengths, from five characters to over 20 characters. They have, as I said, worked well before.

    The main difference now is that the text segment has passed 64kB in length. I fear that I have encountered a post-0xffff-address problem.

    Will this be any problem, from a Segger point of view? The device is a Nordic nRF51 DK.

    regards,
    Elm
  • Hi,

    I tried a larger buffer, well over the size of the largest command. It did not work.
    I also tried reading faster (20ms instead of 100ms) in my target. Thar did not work either.

    I am suspecting an awry pointer, or that text segment size above 64kB is the culprit.

    Elm
  • Okay, I found the error. it is time I start learning to read properly:

    The post by SEGGER - Johannes made the trick. I just had to read it literally:
    "The buffer size for channel 0 (which RTT Viewer sends to) can be configured in SEGGER_RTT_Conf.h"


    I changed the lines:

    C Source Code

    1. #define BUFFER_SIZE_DOWN (16) // Size of the buffer for terminal input to target from host (Usually keyboard input) (Default: 16)
    2. #define SEGGER_RTT_PRINTF_BUFFER_SIZE (64) // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64)



    to:

    C Source Code

    1. #define BUFFER_SIZE_DOWN (128) // Size of the buffer for terminal input to target from host (Usually keyboard input) (Default: 16)
    2. #define SEGGER_RTT_PRINTF_BUFFER_SIZE (128) // Size of buffer for RTT printf to bulk-send chars via RTT (Default: 64)



    and it started working again. Before, my command lines were still over 16 octets, but somehow the program worked anyway.


    regards,
    Elm