[SOLVED] RTTViewer skips lines in logging when MCU is reset

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

  • [SOLVED] RTTViewer skips lines in logging when MCU is reset

    Hello everybody,

    in our development project we have the problem, that whenever we restart our MCU using reset, some lines of the RTT logging are skipped in the RTTViewer.
    Corresponding RTT log output looks e.g. like this:

    Source Code

    1. 00> 0.001 I Broker: ....<valid log statement>
    2. 00> 0.002 W CanStack: ....<valid log statement>
    3. 00> 0.004 D KVS: ....<valid log statement>
    4. 00> RTT buffer full - 5 line(s) skipped.
    5. 00> 0.022 D OnOff: ....<valid log statement>
    6. 00> - 29 line(s) skipped.
    7. 00> 0.488 D Can: ....<valid log statement>
    8. 00> 0.490 D UI: ....<valid log statement>
    The current size of our RTT ring buffer is 2Kb and we think this should be enough and we actually do not want to increase it.
    Presumably, in case of reset of the MCU the RTTViewer does not restart reading out (and therefore empty) the ring buffer quickly enough and this leads to skipped log statement lines.

    Do you have any suggestions how we could avoid this skipping of log statements in the RTTViewer output?
  • Yes, this can happen when using asynchronous mechanisms.
    It is a bit like resetting the MCU while there is a DMA transfer in progress or before a UART was able to send out all data via Tx interrupt + buffer.

    Suggestion:
    Wait for in your software until J-Link has emptied the ring buffer (ideally with timeout) before issuing a self-reset from within your software.


    BR
    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.
  • Hello Alex,

    thanks for your quick reply!

    You mean just adding some kind of delay before issuing an self-reset? Or is there a way to detect in sw whether J-Link is done with emptying the ring buffer?

    During development we often trigger a reset manually vi a hw button on the test jig. What could be done in this use case to avoid skipped lines in the RTTViewer output?

    Best regards
    Paul
  • Hello,

    I have to modify my question:
    Actually the problem of losing log messages in RTTViewer does not only occur in the case of a reset
    Also in cases where bursts of log statements are printed, lines get skipped/lost in the RTTViewer output.
    Please advice which settings regarding RTTViewer I should tweak in order to not loose any log statements.

    Thanks and best regards
  • Hi,
    I can see that you also contacted us via the Support Ticket System.
    I already answered you there.
    We will close this thread, to keep communication to one channel.

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