[SOLVED] JLink Commander : How to modify the JLINK_RTTERMINAL_Read BufferSize?

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

  • [SOLVED] JLink Commander : How to modify the JLINK_RTTERMINAL_Read BufferSize?

    Dear Segger community, I need your help.

    I am using J-LINK Commander to exchange data with a Nordic uP. It is working, but too slow. When I am using the "JLinkRTTViewer" tool to exchange data, it is much more faster. I am pretty sure that the BufferSize of the "JLINK_RTTERMINAL_Read" command slow down the process because when I start the process with the commande line : "jlink.exe -device NRF52832_XXAA -speed 2000-if SWD -autoconnect 1", the buffer size is only 0x100

    Source Code

    1. T263C 009:757 JLINK_RTTERMINAL_Read(BufferIndex = 0, BufferSize = 0x00000100)


    And for the "JLinkRTTViewer" tool it is 0x000FFFFF:

    Source Code

    1. T2230 047:493 JLINK_RTTERMINAL_Read(BufferIndex = 0, BufferSize = 0x000FFFFF)


    How can I change this buffer size?


    I read the manual published here: wiki, and checked and check all commands displayed with "?" command, but I can't figure it out.

    Best regards
  • Hi,


    thanks for your inquiry.
    Could you please provide additional information regarding how you want to use J-Link Commander?
    Or do you just use the Telnet port of the J-Link DLL of a J-Link Commander session?
    For most use cases, the J-Link SDK (Part No 8.08.06 on the price list) is the most suitable way of making the most of RTT, but if this buffer really is the bottleneck in your situation, I will take a look at it, since this seems like an unnecessary limitation.

    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.
  • Thanks you very much for your answer.

    I use a simple TelNet to send 1kB packets to the microcontroller. If I send this 1kB with the JLinkRTTViewer tool, the transfert is very quick (less than 0.5 second) on the other side, with a Telnet the transfert takes more than 4 seconds.


    The only difference I found between the Telnet and the JLinkRTTViewer tool is the buffer size of the JLINK_RTTERMINAL_Read function : 0x100 againgt 0xFFFFF.


    Here is a printsecreen after few seconds (~5s) of Telnet connection. You can see that the number of calls is big.

    [img]https://s13.postimg.org/kn81vl353/segger.png[/img]

    And here after 2-3 seconds, but with the JLinkRTTViewer tool. The number of calls is less important.

    [img]https://s13.postimg.org/pdcbd07c7/segger2.png[/img]

    <img src="https://s13.postimg.org/kn81vl353/segger.png" alt="segger.png" title="segger.png" style="font-size: 0.8em;" />


    My assumption was to find a way to modify the buffer value without purchasing a SDK. But perhaps am I in a wrong way?


    Best regards,


    Sébastien

    The post was edited 2 times, last by Bouillou ().

  • Hi Sébastien,

    in general, if you want to send data to the MCU, the the JLINK_RTTERMINAL_Write() function calls are relevant.

    We have changed the buffer size for sending and receiving over telnet connections to a total of 16kB.
    This ought to be enough for quick transfers using telnet.

    Thank you for pointing this out and best regards,
    Arne

    EDIT: Today's beta release will include the changed buffer sizes.
    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.

    The post was edited 1 time, last by SEGGER - Arne ().

  • Dear Arne,

    Thank you very much to do this change! :thumbsup:

    It allowed me to exchange
    data between my SEGGER and the chip (Nordic nRF52832) with a good speed which is necessary during the personalization phase of our production process.

    BTW, in the beta version I have installed (6.13a) the buffer size is 8kB and not 16kB (0x2000), did you adapt this buffer size?

    Not very related, but you should update or remove the JLink commander wiki page because parameters list is not up to date (RTTTelnetport for example) : wiki.segger.com/index.php?title=J-Link_Commander

    Best regards,

    Sébastien
  • Hi Sébastien,

    there is one 8kB buffer for each sending and receiving.

    The wiki page is not a full reference for the JLink commander, it just gives some additional information on how to use it in automated environments.

    Best regards and thanks for providing feedback,
    Arne
    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.