[SOLVED] Segger Ozone problem - variables out of scope - cannot "watch" or "graph"

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

  • [SOLVED] Segger Ozone problem - variables out of scope - cannot "watch" or "graph"

    Hey everyone,

    I'm pretty new to the world of Segger but so far I'm really happy with it. There's one problem I encounter when using Segger's Ozone tool. I'd like to graph the value of a local variable but Ozone is telling me the following:


    Source Code

    1. Warning (4091): expression "cntr" cannot be graphed: the expression contains at least one operand with an unknown data location.

    When I try to add it to the "Watched Data", the "Location" tab tells me <outofscope>.

    I double checked all the operands, I'm just using ++, % and logical comparison ==, all allowed according to UM08025, p. 145. cntr is basically just a counter that resets after x iterations. This variable is local, declared and defined inside a FreeRTOS Task Function (of course outside the while(1) loop). In fact all other variables declared and defined inside this function/task are not reachable by Ozone with the same error message. What am I doing wrong?

    Thank you very much in advance!
    Tom
  • Hello,

    Thank you for your inquiry.
    Local variables can only be tracked while in the scope of the function where they are initialized and used.
    Outside of that scope the corresponding memory range might be used for something else by the application.
    If you want to track a variable over multiple functions declare it as static outside of the function scope.
    Then it should work.

    Best regards,
    Nino
    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.
  • Dear Nino,

    thank you very much for replying. I'm just wondering how variables can be out of scope inside a task of FreeRTOS which is always running and never gets quit. It would be fatal if the memory location is used for something else. Do I miss something?`

    Could you maybe reply to the following question as well: I own a J-Link Plus, so if I'd like to trace the task calls this can only be done by using the ETB of the uC, right? If the uC (in my case STM32F412) does not support ETB, I can't trace these calls, correct?

    Thanks in advance & best regards
    Tom
  • Hello,


    tronic wrote:

    thank you very much for replying. I'm just wondering how variables can be out of scope inside a task of FreeRTOS which is always running and never gets quit. It would be fatal if the memory location is used for something else. Do I miss something?`
    Is it running all the time? No scheduler action or interrupts in between or similar? Does it not work declaring the variable in a static scope?


    tronic wrote:

    Could you maybe reply to the following question as well: I own a J-Link Plus, so if I'd like to trace the task calls this can only be done by using the ETB of the uC, right? If the uC (in my case STM32F412) does not support ETB, I can't trace these calls, correct?
    With an ETB you would get more than just task calls. This enables you to get all instructions executed and analyzed, including task calls.
    The STM32F4 has an ETM + trace port though. This will generate an instruction trace stream that can be read by our J-Trace PRO probe:
    segger.com/products/debug-probes/j-trace/

    However if you are only interested into following the task flow of your application in a visual way code instrumentation might be the correct pick for you.
    For this our free tool SystemView can be used:
    segger.com/products/development-tools/systemview/

    More information about the different trace types can be found here:
    wiki.segger.com/General_information_about_tracing

    Best regards,
    Nino
    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 Nino,

    first of all, thanks for your help! SystemView now works perfectly.

    I know it's not really up to Segger to support it, but to you see any chance to integrate SystemView in Simplicity Studio by SiLabs?

    Thanks again,
    Tom
  • Hello Tom,

    tronic wrote:

    I know it's not really up to Segger to support it, but to you see any chance to integrate SystemView in Simplicity Studio by SiLabs?
    This would really be something that SiLabs needs to be asked. The target side sources are public so all third party tool provides need to do is read the SystemView data via RTT which SiLabs is capable of.

    Alternatively maybe Simplicity Studio offers some way to launch external software via command line like our IDE Embedded Studio does. In that case you could launch SystemView via command line from within Simplicity Studio.
    How, would be something to ask SiLabs support though.

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