RTT is delayed until breakpoint

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

  • RTT is delayed until breakpoint

    I am working on a demo project using a PyBoard v1.1 (STM32F405RG) and want to use the RTT functionality to assist with live debugging.
    For this i'm using the SEGGER J-link GDB server and RTT client.

    However it seems that I'm having some issues where the RTT buffer only gets read out when I hit a breakpoint somewhere in my application.
    After it hits a breakpoint once, the RTT text seems to work, but lags behind one step from a printf on a serial terminal for a while.
    So the RTT will output "Test: 19" whilst the serial terminal outputs "Test:20".
    After a while, messages start to overlap on the RTT, even though this function is only called maybe once a second, manually via the serial terminal.

    Essentially all i'm doing is this:

    C Source Code

    1. int tests = 0;
    2. STATIC mp_obj_t RTT_test() {
    3. mp_uint_t i = disable_irq();
    4. SEGGER_RTT_printf(0, "Test: %d.\r\n", tests);
    5. enable_irq(i);
    6. printf("Test: %d\r\n", tests);
    7. tests++;
    8. return mp_const_none;
    9. }


    I have tried disabling interrupts which appears to have no effect on the results.
    I have also tried changing the RTT config to it's various modes, which also had no effect.
    Changing the SWD clock speed also had no impact on this.

    Is there anything else I should be doing to get the RTT messages sent correctly?
  • Hi,


    we are currently not aware of any issues regarding RTT.
    We use RTT internally on various occasions.

    Would it be possible for you to provide us with a (stripped-down) project for reproduction purposes?

    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,


    we are currently expanding our eval board collection anyway, so I put a pyboard on the to-be-bought list.
    Did you unsolder the LED resistors in order to debug via JTAG?


    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.
  • I did not de-solder them, but changed the pin configuration around so they are no longer in use by micropython.
    normal debugging appears to work fine even with the LEDs soldered in place, so I figured RTT would work too.

    I have just de-soldered the resistors R4 and R6 to fully disconnect the LEDs just in case, but my results are the same.

    The post was edited 1 time, last by ThomasK ().