Skip to main content
Visitor II
March 27, 2023
Question

The CubeMonitor reads variables as zero and occasionally reads the true value.

  • March 27, 2023
  • 3 replies
  • 1589 views

The symptoms:

We are building with IAR C++

We have 4 global variables that change infrequently and we want to monitor when they change.

We have set up a very simple monitoring program in CubeMonitor (based on the demo version)

When monitoring the variables the variables are read as zero randomly (in fact most of the time) instead of the true value. The variables are not changing but are being monitored incorrectly

The Debug:

Our board uses the ST STM32L471VG.

I have got CubeMonitor working correctly on a Nucleo board with a simple test app.

I have moved the test app to our board (just changed the processor) and it worked correctly.

Using our IOC file the test app does not work.

Disabling IWDG the test app works on our board.

Using our application (with IWDG disabled) and it does not work.

    This topic has been closed for replies.

    3 replies

    Technical Moderator
    March 30, 2023

    Hello @DOrch.1​ 

    At which frequency do you read your variable? can you share your flow?

    DOrch.1Author
    Visitor II
    March 30, 2023
    The following is our flow:
    [
    {
    "id": "7b9ed63e.2138f8",
    "type": "tab",
    "label": "Basic_Flow",
    "disabled": false,
    "info": "# Basic flow to start with STM32CubeMonitor."
    },
    {
    "id": "1ebbb430.dac7dc",
    "type": "ui_chartst",
    "z": "7b9ed63e.2138f8",
    "group": "f9c34dde.1e2f4",
    "name": "myChart",
    "order": 4,
    "width": 15,
    "height": 9,
    "chartType": "line",
    "curveType": "linear",
    "duration": "10",
    "ymin": "",
    "ymax": "",
    "x": 580,
    "y": 280,
    "wires": []
    },
    {
    "id": "6013fb0b.5b7504",
    "type": "acquisition out",
    "z": "7b9ed63e.2138f8",
    "name": "myProbe_Out",
    "probeconfig": "fefda8a2.db0408",
    "x": 520,
    "y": 120,
    "wires": []
    },
    {
    "id": "4a573fb0.4bc99",
    "type": "acquisition in",
    "z": "7b9ed63e.2138f8",
    "name": "myProbe_In",
    "probeconfig": "fefda8a2.db0408",
    "x": 130,
    "y": 280,
    "wires": [
    [
    "a7c3e070.5a6c"
    ],
    []
    ]
    },
    {
    "id": "d59587ff.cd1748",
    "type": "variables",
    "z": "7b9ed63e.2138f8",
    "groupname": "myVariables",
    "accesspoint": 0,
    "execonfig": "7efcd862.ced958",
    "variablelist": [],
    "triggerstartmode": "manual",
    "triggername": "a_AdcState",
    "triggerthreshold": "2",
    "frequency": "",
    "frequencyType": "0",
    "snapshotheader": "",
    "mode": "direct",
    "lastImportedTime": 1679493573084,
    "openStatus": true,
    "x": 330,
    "y": 120,
    "wires": [
    [
    "6013fb0b.5b7504"
    ],
    []
    ]
    },
    {
    "id": "fc00295e.79ada8",
    "type": "ui_button",
    "z": "7b9ed63e.2138f8",
    "name": "",
    "group": "f9c34dde.1e2f4",
    "order": 3,
    "width": 5,
    "height": 1,
    "passthru": false,
    "label": "Clear Graphs",
    "tooltip": "",
    "color": "",
    "bgcolor": "",
    "icon": "",
    "payload": "",
    "payloadType": "str",
    "topic": "clear",
    "x": 430,
    "y": 380,
    "wires": [
    [
    "1ebbb430.dac7dc"
    ]
    ]
    },
    {
    "id": "5fd51c96.2330e4",
    "type": "ui_button",
    "z": "7b9ed63e.2138f8",
    "name": "",
    "group": "f9c34dde.1e2f4",
    "order": 1,
    "width": 5,
    "height": 1,
    "passthru": false,
    "label": "START Acquisition",
    "tooltip": "",
    "color": "",
    "bgcolor": "",
    "icon": "",
    "payload": "",
    "payloadType": "str",
    "topic": "start",
    "x": 110,
    "y": 80,
    "wires": [
    [
    "d59587ff.cd1748"
    ]
    ]
    },
    {
    "id": "52eadfe3.2c8cc",
    "type": "ui_button",
    "z": "7b9ed63e.2138f8",
    "name": "",
    "group": "f9c34dde.1e2f4",
    "order": 2,
    "width": 5,
    "height": 1,
    "passthru": true,
    "label": "STOP Acquisition",
    "tooltip": "",
    "color": "",
    "bgcolor": "",
    "icon": "",
    "payload": "",
    "payloadType": "str",
    "topic": "stop",
    "x": 110,
    "y": 160,
    "wires": [
    [
    "d59587ff.cd1748"
    ]
    ]
    },
    {
    "id": "a7c3e070.5a6c",
    "type": "processing",
    "z": "7b9ed63e.2138f8",
    "groupname": "myVariables",
    "groupid": "d59587ff.cd1748",
    "expressions": [],
    "statistics": [],
    "logmode": "changes",
    "x": 350,
    "y": 280,
    "wires": [
    [
    "1ebbb430.dac7dc"
    ],
    []
    ]
    },
    {
    "id": "f9c34dde.1e2f4",
    "type": "ui_group",
    "name": "Chart",
    "tab": "17d09b07.741a55",
    "order": 1,
    "disp": true,
    "width": 15,
    "collapse": false
    },
    {
    "id": "fefda8a2.db0408",
    "type": "probe",
    "probeid": "36FF6E064B46323633351043",
    "probename": "ST-Link v2 (...51043)",
    "protocol": "SWD",
    "frequency": "4.6 MHz",
    "probeproperty": "{\"SWD\":[\"4.6 MHz\",\"1.8 MHz - Default\",\"950 kHz\",\"400 kHz\",\"150 kHz\"],\"JTAG\":[\"18 MHz\",\"9 MHz\",\"4.5 MHz\",\"2.25 MHz\",\"1.12 MHz - Default\",\"560 kHz\",\"280 kHz\",\"140 kHz\"]}",
    "probeversion": "ST Link firmware version V2.J29",
    "connectionType": "p2p"
    },
    {
    "id": "7efcd862.ced958",
    "type": "exe-config",
    "name": "PwrVar",
    "exefile": "C:\\WorkArea\\iSteamLoop\\gnp268\\ProjectsBuild\\Target\\App\\Exe\\App.out",
    "exefolder": "C:\\WorkArea\\iSteamLoop\\gnp268\\ProjectsBuild\\Target\\App\\Exe",
    "exevariablelist": [
    {
    "address": "0x20000180",
    "name": "a_AdcState",
    "type": 5,
    "checked": true
    },
    {
    "address": "0x2000018c",
    "name": "a_LpuartState",
    "type": 5,
    "checked": true
    },
    {
    "address": "0x20000184",
    "name": "a_Usart1State",
    "type": 5,
    "checked": true
    },
    {
    "address": "0x20000188",
    "name": "a_Usart2State",
    "type": 5,
    "checked": true
    },
    {
    "address": "0x080b10bc",
    "name": "AHBPrescTable[0]",
    "type": 1
    },
    {
    "address": "0x08088cbc",
    "name": "APBPrescTable[0]",
    "type": 1
    },
    {
    "address": "0x080865dc",
    "name": "Application::cIndexToAddress[0]",
    "type": 4
    },
    {
    "address": "0x080866e8",
    "name": "Application::CRCLookup[0]",
    "type": 1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_ACC::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_ADC::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_BAT1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_FUEL::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_HMI::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_NFC::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_NVR1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_PrM1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_PWR1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_PWR1_PIN::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_RTC1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_SER0::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_SER1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_SiC1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_SiM1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_SiS1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_SPI3::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_SPI_BUS::ADDRESS",
    "type": -1
    },
    {
    "address": "0x00000000",
    "name": "Application::N_TDE1::ADDRESS",
    "type": -1
    },
    {
    "address": "0x2000c468",
    "name": "Application::s_oSignalManager",
    "type": 5
    },
    {
    "address": "0x08086514",
    "name": "Application::s_stStacks[0].szTaskName",
    "type": 5
    },
    {
    "address": "0x08086520",
    "name": "Application::s_stStacks[0].ui32EndStack",
    "type": 5
    },
    {
    "address": "0x0808651c",
    "name": "Application::s_stStacks[0].ui32StackOffset",
    "type": 5
    },
    {
    "address": "0x08086518",
    "name": "Application::s_stStacks[0]
    Technical Moderator
    April 6, 2023

    Could not import your json because it's truncated.

    However I can see you're using a sequential loop sampling frequency, which is good.

    Can you try using trigger start mode, in the variable node acquisition parameter, in order to start acquisition when your variable change (you can have one variable node per variable with their own trigger). I just want to verify if this mode is able to detect the value change and understand why you cannot see it in "normal" mode (Could be because the value change and come back to initial value in between 2 read operation?)

    DOrch.1Author
    Visitor II
    April 6, 2023

    Thanks for your support. I am out of the office for a week and will address this when I am back.