[SOLVED] Is Segger RTT SEGGER_RTT_vprintf() reentrant and therefore may be called from within interrupts?

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

  • [SOLVED] Is Segger RTT SEGGER_RTT_vprintf() reentrant and therefore may be called from within interrupts?

    Hi,

    I wonder if Segger's RTT SEGGER_RTT_vprintf() is reentrant and therefore may be called from within interrupts?

    I currently try to do this and have sometimes hard faults which I do not understand.
    I know that SEGGER_RTT_vprintf() needs stack, so I enlarge all my FreeRTOS tasks stacks by 100 bytes (SEGGER_RTT_PRINTF_BUFFER_SIZE = 64) since I do not known which task will in interrupted.

    I appreciate any help.

    regards

    SPR
  • Hi SPR,


    you need to implement
    SEGGER_RTT_LOCK()
    SEGGER_RTT_UNLOCK()
    and disable interrupts and threads which might use RTT in SEGGER_RTT_LOCK() and enable them again in SEGGER_RTT_UNLOCK().
    SEGGER_RTT_LOCK()
    SEGGER_RTT_UNLOCK()
    are already called by default in RTT, but the function bodies are empty and need to be implemented according to your setup / use case.


    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.