real time terminal with uVision

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

  • real time terminal with uVision

    Hi,

    I just discovered the real time terminal functionality available with j-link and I think it's great.

    I also like the feature that printf can be re-targeted to use the Segger RTT, however with uVision the standard way of re-targeting printf() is by supplying my own version of fputc() and fgetc().
    The functions provided and the retarget examples are intended for use at a higher level because they handle the entire string and not 1 character at a time.

    I know that for uVision in fputc() I could just call SEGGER_RTT_Write() and just pass 1 character at a time, but that seems inefficient. Is there a way to retarget higher level functions similar size_t __write() in IAR.

    Or is there a better approach?

    I hope that I explained myself clearly.

    Regards,

    Alex
  • I've been toying with this a bit more.
    I've decided to temporarily use sprintf() and then pass the string to SEGGER_RTT_WriteString()
    Not the most efficient, but it works for now.


    Unfortunatelly it seems that it's not actually running that fast.
    I was initially hoping to use that as a UART replacement to take data out as fast as possible out of the ADuCM320 and it appeared to run very fast until I realised that I was losing loads of data. I reconfigured it to use SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL and that slowed it down significantly.
    I calculated that I was using a speed of ~28.5kBytes/s which would be roughly equivalent to a baud rate of 270kBaud
    On the ADuCM320 the UART can go as fast as 430kBaud.


    So my questions are:

    My main question is trying to figure out in an ideal situation how fast can I send data out of the chip.

    I can't seem to be able to change the speed of the jlink to more than 4000 kHz. Is the the maximum speed on a basic j-link?
    How much of my data is contained in a Serial wire packet. i.e. what is the overheard?
    Are there any tweaks I can look at to increase the speed of the RTT?

    Thank you,
    Alex
  • Hi Alex,

    Thanks for your post.

    I assume you are using the default configuration with RTT which means 256 bytes Tx buffer (Target -> Host), correct?
    This is a bit small for such high data rates. We recommend a buffer of 1 KB here.
    Moreover, we are also working on an improved version for the SEGGER J-Link models (PRO, ULTRA+, PLUS, BASE, ...)
    which will improve the RTT speed. This is planned for one of the next software versions.


    SWD speed:
    The current hardware version of J-Link BASE supports up to 12 MHz SWD speed. So you should definitely be able to use SWD speeds higher than 4 MHz.


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

    We have built a first beta version (V4.95a) which comes with improved SEGGER RTT read speed.
    J-Link models affected by this improvement:
    J-Link BASE V9 => Up to 500 KB/s RTT read speed
    J-Link PLUS V9 => Up to 500 KB/s RTT read speed
    J-Link ULTRA+ V4 => Up to 1 MB/s RTT read speed
    J-Link PRO V4 => Up to 1 MB/s RTT read speed

    Download: segger.com/jlink-software-beta-version.html
    Info about SEGGER RTT: segger.com/jlink-real-time-terminal.html

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