[SOLVED] J-Scope, finding RTT

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

  • [SOLVED] J-Scope, finding RTT

    I have custom Cortex silicon here. Our device is not on the enumerated lists and it cannot search for the RTT block. It was a problem to use the RTT Viewer in that it couldn't auto-locate the RTT, but we got it working. We ended up putting the RTT block in an explicitly stated memory location and typing that in when launching RTT Viewer.

    Now, we need to run J-Scope from RTT. However, unlike RTT Viewer, I don't see any option to explicitly state where the RTT block is. I even tried manually editing MCU.csv and adding a line for our device bit that didn't work, for whatever reason the .csv doesn't change the list on RTT Viewer/J-Scope.

    Can I create a jscope_project file and just edit in the RTT address and reload that? What's the XML for the RTT address?

    Do I launch Jlink Commander and just use the connection for the J-Scope? How do I tell the Commander an explicit RTT address?

    How can I use J-Scope with RTT?

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

  • Hi,

    it is possible to pass a RTTSearchRange via commanline parameter:
    Syntax (CMD -rs, --rttsearch)
    rttsearch <RangeAddr> <RangeSize> [, <RangeAddr1> <RangeSize1>, ..]
    JScope.exe --rttsearch "0x10000000 0x1000"
    JScope.exe --rttsearch "0x10000000 0x1000, 0x20000000 0x1000"

    This Option is currently not documented in UM8028, we will fix this in the near future.

    I even tried manually editing MCU.csv and adding a line for our device bit that didn't work, for whatever reason the .csv doesn't change the list on RTT Viewer/J-Scope.

    This files are only used by old versions of J-Flash and do not have any effect on J-Scope.

    Do I launch Jlink Commander and just use the connection for the J-Scope?

    This is possible, but as stated in UM8028, RTT can not be used in attach mode. (-> HSS only).

    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.
  • OK, got it loaded!

    What I saw is that initially we had a byte reading out ok at 5Ksamp/sec.

    Increasing the sample rate to 10 Ksamp/sec means JScope will NOT start. I load, set up the JTAG, press the red "record" circle, it will find the RTT buffer and crash "JScope.exe has stopped working" in a flash.

    MCU code is using SEGGER_RTT_MODE_NO_BLOCK_SKIP with a 5K RTT buffer. My first thought is the buffer overruns, which should only cause lost samples in NO_BLOCK_SKIP mode, but I could see where maybe that breaks JScope.exe.

    But:

    segger.com/jlink-rtt.html

    Say JLink base model (I have JLink OB on my desk through USB, should be USB 2.0) @15MHz is 700KB/sec. USB 2.0 presents a 60MB/sec limit so that's not a factor. Up buffer is 5KB, so that shouldn't be a factor. But 5KB/sec (5000 byte samples) works, 10KB/sec crashes every time for me. Even at the 4 MHz we normally use for JTAG here, no way is bandwidth a limit in this situation, right?

    I tried changing to SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL for the buffer. Same thing, it finds the RTT control block, then immediately crashes JScope.exe.

    Any idea why we're crashing at this speed, and/or how to fix it?

    2 side questions:
    1. Is it possible to add the search range to the project file XML? I see that it did not store anything about the address range yet.
    2. Can I specify a project file on the jscope.exe command line?

    The post was edited 4 times, last by Dannym ().

  • Hi,

    I forwarded this thread to the J-Scope maintainer.
    Say JLink base model (I have JLink OB on my desk through USB, should be USB 2.0

    Do understand you correctly that you are using a J-Link OB for RTT? Please note that a J-Link-OB is way slower than a J-Link Base.
    However, J-Scope should not crash.

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

    could you please try it with our recent beta?

    download.segger.com/Arne/Setup_JScope_V511.exe

    If it is still crashing, could you please upload the J-Link log file?

    SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL and SEGGER_RTT_MODE_NO_BLOCK_SKIP should both be usable. Are you sending out the data in one call per block in your application?

    Regards
    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.
  • Trying Jscope v511. Nope, v511 will crash as soon as it discovers the RTT block, if more than 5ksamples/sec (bytes) are being sent. However, there's no "jscope.exe has stopped working" message. The whole jscope window just closes and disappears instantly.

    Where is the log file? Nothing was generated in \program files (x86)\SEGGER\JScope_V511\

    I send byte data for simplicity.

    p->aUp[1].sName = "JScope_u1";

    SEGGER_RTT_Write(1, &dataArray[0],1);

    I did not know the JLink OB was slower than the JLink Base. I don't have the Base on my desk right now. However, I'm sure it's acting the same way.
  • Further investigation:

    The JScope will crash if the buffer is filled prior to its starting up. That is the normal situation- the MCU is reset, the code runs, it puts samples in the RTT buffer, and it will almost certainly be filled up before JScope starts recording. Then we run JScope.exe. You can't press "record" on JScope until the MCU is running, there will be no RTT buffer to find.

    When I added a 5 sec delay before putting samples on the RTT, then JScope.exe didn't crash upon loading (the 5MB/sec transfer problem does not exist, there is no transfer). A couple of seconds later the MCU starts loading the RTT buffer and I saw a 37Msamp/sec transfer rate!

    Which is odd... without the startup delay, the 5K RTT buffer is pretty much guaranteed to be filled even with the 5Msamp/sec rate that does NOT crash JScope. JScope finds a 100% full buffer upon launch regardless of sample rate. It's only if the RTT buffer is full AND the incoming new sample rate is >5Msamp/sec that it crashes immediately.

    Wait, not quite. This works if the RTT buffer is SMALL, 1KB. When I upped the buffer size to 2KB, then JScope DID start recording, it displayed a short window of samples with 47Ksamp/sec, but then crashed.

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

  • Just discovered that even if JScope gets started without crashing, it will still crash within a few minutes, unless the bitrate is kept low.

    Weirdly the RTT Sample rate shown is very unstable. 28K, 26k, 30K, 24K, etc. It's off an ADC with a very regular sample rate.
  • Hi,


    yesterday was a bank holiday in Germany.
    Log output can be enabled like as follows:
    • Open a connection to J-Link, e.g start J-Link Commander
    • In J-Link Control Panel: (Click the J-Link symbol located in the notification / tray area in order to open J-Link Control panel)
    • Open the tab "Settings"
    • Next to the field "Log file" check "Override" and click "..." in order to choose a log file path.

    This is also described in UM8001 Chapter 5 "Working with J-Link and J-Trace", Section 5.7 "J-Link control panel" .

    We will investigate this issue.
    Could you provide us with a (stripped down, no IP needed) sample project?
    What core do you use? (Cortex-M3, Cortex-M4,...)
    How often does you application write to the Buffer?

    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.
  • Dannym wrote:

    I send byte data for simplicity.

    p->aUp[1].sName = "JScope_u1";

    SEGGER_RTT_Write(1, &dataArray[0],1);

    I did not know the JLink OB was slower than the JLink Base. I don't have the Base on my desk right now. However, I'm sure it's acting the same way.
    Hi,

    this information was all I needed to find the problem.
    Please download the fixed beta version (same link as above) and try again.

    If the RTT sample rate is still unstable/unreasonable, please write us again.
    I'm currently running a RTT session with 20kSamples/s and the measured value differs about +/- 1%.

    Regards
    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.