[SOLVED] OS_InInt seems to be corrupted

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

  • [SOLVED] OS_InInt seems to be corrupted

    Hi!

    I keep running into OS_GetMail( m_pMbox, ipc ) triggering OS_ASSERT_CPU_IN_TASK_MODE() which is strange since the function is called by a regular task.

    When I set a breakpoint in OS_AssertTaskMode() I can see that OS_InInt contains often the value 0xDD (but also occasionally other values). I think this is not a "normal" value of this variable and that it may somehow have gotten corrupted. Do you have tips on how I could debug this issue ?
  • Hi Dimitri,

    Can you give more information on what specific embOS port and version you are working with?

    Dimitri wrote:

    Hi!
    I think this is not a "normal" value of this variable and that it may somehow have gotten corrupted.
    OS_Global.InInt (or, in previous versions, OS_InInt) is increased once for every call to OS_INT_Enter[Nestable](), but application interrupts typically will not nest each other more than 200 times. I'd therefore agree that this is likely due to a corruption of that variable.

    Dimitri wrote:

    Do you have tips on how I could debug this issue ?
    Depending on the used architecture, IDE and/or debug probe you might be able to configure data watch points that trigger when the upper bits of OS_InInt are written to. Since this will not happen in typical applications where interrupts do not nest each other that often, this should then give you an idea on what part of the application is corrupting the variable.

    Please feel free to contact us via Email or our support ticket system as well in case you're entitled to regular embOS support (i.e. you have a valid "support & update agreement"). This will also allow to share snippets of embOS source code - please refrain from posting them here. Thank you for your understanding!

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