[SOLVED] Reading system variables returns wrong values

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

  • [SOLVED] Reading system variables returns wrong values

    Hello,
    I'm trying to customize the startup process for flashing an application with bootloader. However I want some manual actions (like resetting or connecting without download) still work relatively "normal", so my idea was to check the state of some variables within the customized callbacks in the Ozone project file to do different things.
    Now to the problem: I've found out that there is a system variable VAR_CONNECT_MODE to define the type of connection/download (although this variable name is nowhere listed in the Ozone documentation!). But reading this variable always returns 0xC, no matter which of the modes CM_DOWNLOAD_RESET/CM_ATTACH/CM_ATTACH_HALT has been set before. This seems like a bug. Can you confirm?
    The possible values CM_DOWNLOAD_RESET/CM_ATTACH/CM_ATTACH_HALT evaluate to 0/1/2 respectively, so where does that 0xC come from?

    I tried:
    Util.LogHex("VAR_CONNECT_MODE=", VAR_CONNECT_MODE); -> always prints "VAR_CONNECT_MODE=0xC"
    if (VAR_CONNECT_MODE == 0xC) {Util.Log("true");} -> always prints "true"

    A similar phenomenon happens with reading VAR_RESET_MODE which returns 0x10 although the possible values RM_RESET_AND_RUN/RM_RESET_HALT/RM_BREAK_AT_SYMBOL are 0/1/2.

    I'm using Ozone V3.26e.
  • Hi LordNelson,
    system variables cannot be accessed from a .jdebug-file in any other means but as a parameter to the Edit.SysVar() command.Evaluating the identifier of a system variable, as you attempted, may yield unpredictable results. So I can confirm the behavior you observe, yet I cannot confirm this being a bug in Ozone.
    Besides, apparently you are using a J-Link Base with Ozone. Please note that the use of Ozone with J-Link Base is limited to evaluation purposes only. In case you intend using Ozone in a productive environment, please upgrade to a J-Link Plus or higher. It also appears to be the case that your J-Link is not registered. I kindly ask you to register your product. Details on how to register can be found here: wiki.segger.com/J-Link_Registration#How_To.
    Best regards
    -- AlexD
    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.